Since this seems to only look for setTimeout, which is a relatively rare
construct in xpcshell tests, should we be looking for do_timeout calls
that use a non-zero argument as well?
Cheers,
Josh
On 7/28/17 11:48 AM, Andrew Halberstadt wrote:
As part of a larger effort to reduce oranges, we are starting to lint our
tests for common causes of intermittent failures. One low-hanging fruit is
preventing setTimeout with an arbitrary value (aka non-zero) as opposed to
waiting for an appropriate event. The mochitest harness already prevents
this in the harness itself (SimpleTest.requestFlakyTimeout), so this rule
is only enabled on xpcshell tests for now.
If you need to use a flaky setTimeout for some reason, you can disable the
rule at the directory level, file level or line level:
http://eslint.org/docs/user-guide/configuring#configuring-rules
It has been disabled in the following files due to pre-existing violations:
http://searchfox.org/mozilla-central/search?q=eslint-disable+mozilla%2Fno-arbitrary-setTimeout
Let me know if you think this should be enabled on any other test suites.
-Andrew
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform