gravitystorm left a comment (openstreetmap/openstreetmap-website#6712)

So my usual approach to these issues is to avoid any sleep statements 
whatsoever. If there's a synchronisation issue, sleeps just mask the actual 
problem, which is waiting for completion rather than waiting a fixed amount of 
time. I always find that there's some combination of laptop or CI busyness, 
that will find a way to occasionally take slightly longer than whatever sleep 
delay is set! I also find that as soon as `sleep` in tests becomes acceptable, 
they multiple like rabbits.

My other usual approach is to lean heavily on the built-in waiting that comes 
for free with most capybara/selenium commands. So things like `visit "foo"; 
assert_content "bar"` don't normally fail, even if the page load takes 500ms, 
because assert_content will intelligently wait. This means that if I reviewed 
the current code, my first instinct would be the exact opposite of 
https://github.com/openstreetmap/openstreetmap-website/pull/6589 🤔 

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/6712#issuecomment-3780090265
You are receiving this because you are subscribed to this thread.

Message ID: 
<openstreetmap/openstreetmap-website/issues/6712/[email protected]>
_______________________________________________
rails-dev mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/rails-dev

Reply via email to