Closed Bug 1596165 Opened 5 years ago Closed 3 years ago

Consider removing the initial wait from TestUtils.waitForCondition.

Categories

(Toolkit :: General, task, P3)

task

Tracking

()

RESOLVED FIXED
88 Branch
Tracking Status
firefox88 --- wontfix
firefox89 --- fixed

People

(Reporter: emilio, Assigned: florian)

References

(Depends on 5 open bugs)

Details

Attachments

(3 files)

In https://phabricator.services.mozilla.com/D52833 (bug 1595285) I naively changed waitForCondition from doing:

setInterval(async function() { ... }, interval);

to:

async function tryOnce() {
  // ...
  setTimeout(tryOnce, interval);
}
tryOnce();

That happened to break a bunch of tests which weren't expecting the initial check to be synchronous, so I had to change the last line to:

setTimeout(tryOnce, interval);

We should consider removing that.

Priority: -- → P3

(In reply to Emilio Cobos Álvarez (:emilio) from comment #0)

That happened to break a bunch of tests which weren't expecting the initial check to be synchronous,

I think it's reasonable for tests to expect this function to not be synchronous, but the initial 100ms wait is nasty as it makes tests implicitly wait for "stuff" to happen during these 100ms... and sometimes that stuff can take longer, and cause intermittent failures.

I'm proposing to change the last line to: TestUtils.executeSoon(tryOnce);. This should speed up the tests significantly, but avoid the synchronous call, and avoid the timer.

This still causes LOTS of test failures (most of them are existing intermittent failures that become perma fail), that I'll try to resolve in dependent bugs.

Assignee: nobody → florian
Status: NEW → ASSIGNED
Depends on: 1697800
Depends on: 1697804
Depends on: 1665786
Depends on: 1698769
Depends on: 1698771
Depends on: 1698774
Depends on: 1425879
Pushed by fqueze@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3ae4c40c2d0f
Avoid browser_aaa_eventTelemetry_run_first.js failures by putting back a 100ms timer before the waitForCondition call, r=Gijs.
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 88 Branch

Reopening, I forgot to put the leave-open keyword here before landing a first batch of test fixes.

Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Depends on: 1700683
Depends on: 1498063
Depends on: 1700685
Depends on: 1667216
Depends on: 1515466
Depends on: 1660723
Depends on: 1700735
Pushed by fqueze@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7d8fb53c8fcb
add back timers for tests that permafail without the waitForCondition initial timer, r=Gijs.
https://hg.mozilla.org/integration/autoland/rev/4eccbb3d6549
Remove the initial timer in TestUtils.waitForCondition, r=Gijs.
Depends on: 1695011
Depends on: 1695395
Pushed by fqueze@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/21067aab87ee
add back timers for tests that permafail without the waitForCondition initial timer, r=Gijs.
https://hg.mozilla.org/integration/autoland/rev/8581dbde5b5b
Remove the initial timer in TestUtils.waitForCondition, r=Gijs.
Status: REOPENED → RESOLVED
Closed: 3 years ago3 years ago
Resolution: --- → FIXED
Regressions: 1629034
Flags: needinfo?(florian)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: