A few years ago I spent quite some time investigating our intermittent
oranges in the tests living on mozilla-central, and in the process I
ended up fixing a lot of bad patterns in our tests. Using setTimeout's
like this is definitely one of them.
I wrote this article
<https://developer.mozilla.org/en-US/docs/Mozilla/QA/Avoiding_intermittent_oranges>
on these types of patterns back in the day, and I believe most if not
all of those points are applicable to b2g/gaia as well.
Hope this helps.
Ehsan
On 12/17/2013, 8:06 AM, Dale Harvey wrote:
Investigating some unit test failures I am seeing a lot of setTimeout's
located inside the tests, someone already made a meme for me for the
occasion
http://mozillamemes.tumblr.com/post/24322890551/now-if-you-add-an-event-listener-that-sets-a
More specifically everyone is gonna have a bad time because we will have
buggy intermittent tests and closed trees, just a reminder for coders and
more specifically reviewers that setTimeouts should pretty much only be
used to yield / spin the event loop inside tests, not for any form of timer
/ waiting solution
Cheers
Dale
_______________________________________________
dev-gaia mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-gaia
_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g