tests/support/popupBoot.js replaces setInterval while a popup test runs and restores it in cleanupPopup(), but leaves setTimeout alone. showFlash() in src/popup/views/helpers.js starts a two-second setTimeout to clear the flash message.
What happens
A popup test that shows a flash message ends, cleanupPopup() removes the page, and two seconds later the timer fires, finds no document, and throws "document is not defined". In a jest worker that has moved on to another test file, that throw can fail or crash the other file; it was seen failing tests/buildWatch.test.js. Several existing tests leave the timer running. make test can then fail on a tree with nothing wrong in it.
What should happen
A popup test leaves nothing running after cleanupPopup(), so one test file can never fail another.
Severity: minor
Definition of done
No timer started by the popup outlives cleanupPopup().
A test shows a flash message, cleans up, advances past the flash duration, and nothing throws.
Model: opus-5-5
Seen by the reviews of https://git.eeqj.de/sneak/AutistMask/pulls/572 and https://git.eeqj.de/sneak/AutistMask/pulls/573.
## Where
`tests/support/popupBoot.js` replaces `setInterval` while a popup test runs and restores it in `cleanupPopup()`, but leaves `setTimeout` alone. `showFlash()` in `src/popup/views/helpers.js` starts a two-second `setTimeout` to clear the flash message.
## What happens
A popup test that shows a flash message ends, `cleanupPopup()` removes the page, and two seconds later the timer fires, finds no `document`, and throws "document is not defined". In a jest worker that has moved on to another test file, that throw can fail or crash the other file; it was seen failing `tests/buildWatch.test.js`. Several existing tests leave the timer running. `make test` can then fail on a tree with nothing wrong in it.
## What should happen
A popup test leaves nothing running after `cleanupPopup()`, so one test file can never fail another.
Severity: minor
## Definition of done
- [ ] No timer started by the popup outlives `cleanupPopup()`.
- [ ] A test shows a flash message, cleans up, advances past the flash duration, and nothing throws.
Model: opus-5-5
clawbot
self-assigned this 2026-10-19 02:51:20 +02:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Seen by the reviews of #572 and #573.
Where
tests/support/popupBoot.jsreplacessetIntervalwhile a popup test runs and restores it incleanupPopup(), but leavessetTimeoutalone.showFlash()insrc/popup/views/helpers.jsstarts a two-secondsetTimeoutto clear the flash message.What happens
A popup test that shows a flash message ends,
cleanupPopup()removes the page, and two seconds later the timer fires, finds nodocument, and throws "document is not defined". In a jest worker that has moved on to another test file, that throw can fail or crash the other file; it was seen failingtests/buildWatch.test.js. Several existing tests leave the timer running.make testcan then fail on a tree with nothing wrong in it.What should happen
A popup test leaves nothing running after
cleanupPopup(), so one test file can never fail another.Severity: minor
Definition of done
cleanupPopup().Model: opus-5-5