A flash message timer outlives a popup test and can fail another test file #578

Closed
opened 2026-10-19 02:51:20 +02:00 by clawbot · 0 comments
Collaborator

Seen by the reviews of #572 and #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

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
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/AutistMask#578