Open Bug 1901294 Opened 26 days ago Updated 24 days ago

Increase extensions.background.idle.timeout in unit tests, at least for slow tests like asan / TV

Categories

(WebExtensions :: General, task, P2)

task

Tracking

(Not tracked)

People

(Reporter: robwu, Unassigned)

References

Details

(Whiteboard: [addons-jira])

I have recently noticed several test failures, ranging from unexpected messages to timeouts that all boil down to the issue of the test extension's background script (event page) being shut down unexpectedly in the middle of the test execution.

Examples:

To avoid this noise in intermittent failures, we should set extensions.background.idle.timeout to a high value, e.g. 300000 (5 minutes, up from the default 30 seconds). At least for builds that are known to be slow such as asan, tsan, MOZ_CHAOSMODE (TV aka --verify). Unless there is a good reason to make it build-specific, I recommend setting the pref unconditionally so that the test behavior is consistent across different jobs. Tests that expect event page termination should explicitly set a shorter timeout to exercise the behavior (this is already done, otherwise existing tests would wait for 30 seconds for no good reason).

Note: there is a separate issue (bug 1899772) in a test utility (terminateBackground): if the terminateBackground is called while an event was still being dispatched, then the termination request is silently ignored (ext-background.js terminateBackground implementation). This can already result in unexpectedly longer running tests (+30 seconds due to the default timeout), but with the change proposed here this problem could become even more visible. I recommend fixing the test utility to throw a hard error if the termination is ignored (with an opt-out in case a test explicitly wants to test the timeout behavior).

Bug 1777018 has a spike in ASAN failures. We're going to try setting the pref as suggested here on ASAN only for a specific test, and if that improves the failure rates, we're going to expand that pref to all asan/tsan tests if possible.

Severity: -- → N/A
Depends on: 1777018
Priority: -- → P2
Whiteboard: [addons-jira]
You need to log in before you can comment on or make changes to this bug.