logo
podcast Podcast
get help Get Unstuck

Why would you ever sleep in a test?

Not just a dirty hack sometimes

Joel Clermont
Joel Clermont
2025-06-12

You might think adding sleep() inside a test is a dirty hack to fix a flaky test, and I would normally agree with you. But as developers love saying... "it depends"

In today's video, I'll show a scenario where it is actually a useful and valid testing strategy.

Watch Now (4 min)

And after watching, don't forget to subscribe to our YouTube channel, so you don't miss future videos.

Here to help,

Joel

P.S. Want to learn how to write effective tests, even in an older untested Laravel app? This is covered in our Laravel testing workshop.

Toss a coin in the jar if you found this helpful.
Want a tip like this in your inbox every weekday? Sign up below 👇🏼
email
No spam. Only real-world advice you can use.