Remove exceptions added by allowMatchingRejectionsGlobally after each test
Categories
(Testing :: Mochitest, task, P3)
Tracking
(firefox154 fixed)
| Tracking | Status | |
|---|---|---|
| firefox154 | --- | fixed |
People
(Reporter: jdescottes, Assigned: jdescottes)
References
Details
Attachments
(1 file, 1 obsolete file)
The helper allowMatchingRejectionsGlobally allows to ignore promise rejections matching a given regexp:
allowMatchingRejectionsGlobally(regExp) {
this._globalRejectionIgnoreFns.push(rejection =>
regExp.test(rejection.message)
);
},
However, _globalRejectionIgnoreFns is never emptied. This means that if any test calls allowMatchingRejectionsGlobally, all the subsequent tests in the suite will be impacted. This means also some tests can fail in isolation, but succeed in a suite (example: Bug 1655411).
I don't know if we should modify the behavior, or just add an API to cleanup the array so that individual tests can cleanup the state on demand.
Comment 1•4 years ago
|
||
CC'ing Joel in case it's something we want to see fixed. It will also affect some Remote Agent mochitests soon, and a workaround would be to put these specific files into their own manifest file.
| Assignee | ||
Comment 2•1 month ago
|
||
(In reply to Julian Descottes [:jdescottes] from comment #0)
I don't know if we should modify the behavior, or just add an API to cleanup the array so that individual tests can cleanup the state on demand.
I will do the latter, seems safer than impacting all the tests currently using this. Consumers which care about cleaning up the state can call the API in registerCleanupFunction.
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Comment 3•1 month ago
|
||
Updated•1 month ago
|
Updated•1 month ago
|
| Assignee | ||
Comment 4•1 month ago
|
||
| Assignee | ||
Updated•1 month ago
|
Updated•1 month ago
|
Comment 6•1 month ago
|
||
| bugherder | ||
Description
•