test(core): Improve offline transport test performance
extracted from #13439
based on #13458
This PR significantly improves the performance of our offline transport unit tests. These tests were the bottleneck of our unit test performance previously, as they included actual multi-second timeouts. This PR converts the test to use vitest's fake timers which as far as I can tell, still tests the offline transport correctly but heavily increases performance.
Locally, I this brought down the runtime of the entire test suite from ~20s to ~6s.
@timfish would you mind giving this PR a quick review - I think you wrote the tests initially, right?
Argh I tried converting this to jest after giving up on switching to vitest (#13458). Turns out jest fake timers work differently and I couldn't get the tests passing after making the switch. I don't have the time to revisit so I'm gonna close this for now.