toolkit/components/extensions/test/xpcshell/test_MatchPattern.js fails frequently in parallel
Categories
(WebExtensions :: General, defect, P3)
Tracking
(firefox149 fixed)
| Tracking | Status | |
|---|---|---|
| firefox149 | --- | fixed |
People
(Reporter: florian, Assigned: zombie, NeedInfo)
References
Details
(Whiteboard: [addons-jira])
Attachments
(1 file)
This happens about 20 times a day, and isn't visible on treeherder because the xcpshell tests failing in parallel then re-run a second time sequentially.
Here's a profile of a failure: https://share.firefox.dev/46x0A0P
The failure message was: [test_MatchGlob_redundant_wildcards_backtracking : 527] First matching duration: 402ms (limit: 20ms) - 402 < 20
This happened on a Mac machine that was running slowly (I suspect it of over heating).
https://searchfox.org/firefox-main/rev/21d3e8ab8b61715ddd39ac04c62a846fa79deddd/toolkit/components/extensions/test/xpcshell/test_MatchPattern.js#490-540 seems non-deterministic. Especially, it attempts to measure performance by measuring wall clock time. I think it could be more reliable if it measured CPU time instead (especially for tests that are running in parallel with 30 other tests running at the same time).
Here's some example code of how to measure CPU time from an xpcshell test:
// Get total CPU time for the current process and all its children
async function getTotalCpuTime() {
let procInfo = await ChromeUtils.requestProcInfo();
let totalCpuTime = procInfo.cpuTime;
// Add CPU time from all child processes
for (let child of procInfo.children) {
totalCpuTime += child.cpuTime;
}
return totalCpuTime;
}
Calling it instead of Date.now() should provide something more deterministic.
| Assignee | ||
Updated•5 months ago
|
Updated•5 months ago
|
| Assignee | ||
Comment 1•5 months ago
|
||
Updated•5 months ago
|
Updated•5 months ago
|
Updated•5 months ago
|
Comment 4•1 month ago
|
||
Backed out for causing xpcshell failures on test_MatchPattern.js
Comment 6•1 month ago
|
||
| bugherder | ||
Description
•