Closed Bug 1828013 Opened 2 years ago Closed 2 years ago

Fail browser tests that leave repeating timers behind

Categories

(Core :: XPCOM, task)

task

Tracking

()

RESOLVED FIXED
114 Branch
Tracking Status
firefox114 --- fixed

People

(Reporter: florian, Assigned: florian)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

Repeating timers that are unexpectedly left running waste power. It would be useful to ensure we have no new repeating timer running at the end of every browser test to catch existing cases in our code base, and avoid introducing new ones.

Depends on: 1828167
Depends on: 1828685
Pushed by fqueze@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6670ea78c44c Add a scriptable API to list all current nsITimer instances, r=smaug. https://hg.mozilla.org/integration/autoland/rev/7a4c240d12ad Fail browser tests that leave repeating timers behind, r=Gijs.
Pushed by nfay@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1f216436fe2b Skip the new test_getTimers.js xpcshell test on Android where there are multiple timers already present at xpcshell startup. CLOSED TREE
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 114 Branch

For what it's worth, I'm trying to enable DevTools browser mochitests with http3, and I see relatively frequent intermittents from this assert:

TEST-UNEXPECTED-FAIL | devtools/client/inspector/animation/test/browser_animation_keyframes-progress-bar_after-resuming.js | test left unexpected repeating timer nsHttpConnectionMgr

link

It doesn't feel like those tests do anything network related, not sure how I could investigate those failures?

(In reply to Julian Descottes [:jdescottes] from comment #7)

For what it's worth, I'm trying to enable DevTools browser mochitests with http3, and I see relatively frequent intermittents from this assert:

TEST-UNEXPECTED-FAIL | devtools/client/inspector/animation/test/browser_animation_keyframes-progress-bar_after-resuming.js | test left unexpected repeating timer nsHttpConnectionMgr

link

It doesn't feel like those tests do anything network related, not sure how I could investigate those failures?

To see what's happening, I would recommend capturing a profile of the failing test, including the timer thread, so that you can look at timer markers.

To include the timer thread, add MOZ_PROFILER_STARTUP_FILTERS="main,timer" to the environment.

If you can reproduce locally, you can get a profile with:
MOZ_PROFILER_STARTUP_FILTERS="main,timer" ./mach test <path to test> --profiler

If you can only reproduce on try, you can use:
./mach try fuzzy --env MOZ_PROFILER_STARTUP=1 --env MOZ_PROFILER_STARTUP_FILTERS="main,timer"

See also bug 1821691 for nsHttpConnectionMgr timers that are not canceled (soon enough).

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: