Open Bug 2035490 Opened 4 months ago Updated 4 months ago

Make event_leak_utils.js more stable

Categories

(Core :: DOM: UI Events & Focus Handling, task, P3)

task

Tracking

()

People

(Reporter: arai, Unassigned)

References

Details

event_leak_utils.js has the following code, which is heavily timing dependent, and a source of intermittent failures.

https://searchfox.org/firefox-main/rev/298f495e520d43a74d22d83ce39b78eb47d89563/dom/events/test/event_leak_utils.js#75-81

// Perform many GC's to avoid intermittent delayed collection.
// Spin the event loop between attempts so that async cleanup
// runnables (e.g. WebSocket close handshake) can drain before GC.
for (let i = 0; i < 3; i++) {
  await new Promise(resolve => setTimeout(resolve, 0));
  await new Promise(resolve => SpecialPowers.exactGC(resolve));
}

It at least should wait for the condition more reliably instead of just stopping at 3 ticks.

See Also: → 1786672, 2027803

with the following modification, the test times out for my case. So another fix is necessary.
https://hg-edge.mozilla.org/try/rev/c6d8c3d7ed41cf988e8bf366ee126ef86ed62571

Lowering the priority for now, but I think a similar kind of fix is necessary anyway.

Priority: P1 → P3
Assignee: arai.unmht → nobody
Status: ASSIGNED → NEW
You need to log in before you can comment on or make changes to this bug.