Sorry, this video is for subscribers only.

Click here to subscribe!

Eliminate the Test Race

Our real-time server test has a race condition: when we create (or close) a websocket, we need to wait for it to be created (or closed). But for how long? Hardcoded timers are a bad idea—they’re slow and prone to intermittent failure. So instead, we write a “waitUntil()” function that’s fast, reliable, and provides a nice timeout message.

comments powered by Disqus