test: the test suite exits on its own, without --forceExit (closes #585) #710

Merged
clawbot merged 1 commits from issue-585-no-force-exit into next 2026-10-28 01:09:13 +01:00
Collaborator

Some tests left timers running when they ended, and --forceExit hid them. Both test scripts in package.json drop it.

Left open, by file:

  • tests/backgroundApproval.test.js: the background's 20-second timer, which runs while a test leaves an approval pending. It is now stubbed for the whole file, not one describe block.
  • tests/backgroundStateIsolation.test.js: the same timer, now stubbed.
  • tests/chainSwitchGate.test.js: the same timer, now stubbed.
  • tests/coldWorkerChainSwitch.test.js: the same timer, now stubbed.
  • tests/coldWorkerSendTransaction.test.js: the same timer, now stubbed.
  • tests/connectedSitesWorkerRestart.test.js: the same timer, now stubbed.
  • tests/addressKey.test.js: a flash message's timer, now on fake timers.
  • tests/deleteWalletLostPassword.test.js: a flash message's timer, now on fake timers.
  • tests/sendAmountRule.test.js: a flash message's timer, now on fake timers.
  • tests/sendMax.test.js: a flash message's timer, now on fake timers.
  • tests/walletDefects.test.js: a flash message's timer, now on fake timers.

A test that waited on real zero-delay timeouts to let a screen settle now calls jest.advanceTimersByTimeAsync(0) instead.

In tests/backgroundApproval.test.js, the one test that spies on that timer itself is unchanged: jest.spyOn hands it the file's stub.

Judgement call: ethers' own short timers still end after some tests: a 250 ms request cache and a 0 ms network event. They stop by themselves, and no test can reach them.

Model: opus-5-5

Some tests left timers running when they ended, and `--forceExit` hid them. Both test scripts in `package.json` drop it. Left open, by file: - `tests/backgroundApproval.test.js`: the background's 20-second timer, which runs while a test leaves an approval pending. It is now stubbed for the whole file, not one `describe` block. - `tests/backgroundStateIsolation.test.js`: the same timer, now stubbed. - `tests/chainSwitchGate.test.js`: the same timer, now stubbed. - `tests/coldWorkerChainSwitch.test.js`: the same timer, now stubbed. - `tests/coldWorkerSendTransaction.test.js`: the same timer, now stubbed. - `tests/connectedSitesWorkerRestart.test.js`: the same timer, now stubbed. - `tests/addressKey.test.js`: a flash message's timer, now on fake timers. - `tests/deleteWalletLostPassword.test.js`: a flash message's timer, now on fake timers. - `tests/sendAmountRule.test.js`: a flash message's timer, now on fake timers. - `tests/sendMax.test.js`: a flash message's timer, now on fake timers. - `tests/walletDefects.test.js`: a flash message's timer, now on fake timers. A test that waited on real zero-delay timeouts to let a screen settle now calls `jest.advanceTimersByTimeAsync(0)` instead. In `tests/backgroundApproval.test.js`, the one test that spies on that timer itself is unchanged: `jest.spyOn` hands it the file's stub. Judgement call: ethers' own short timers still end after some tests: a 250 ms request cache and a 0 ms network event. They stop by themselves, and no test can reach them. Model: opus-5-5
clawbot added the needs-review label 2026-10-28 00:46:25 +01:00
clawbot self-assigned this 2026-10-28 00:46:25 +01:00
clawbot added 1 commit 2026-10-28 00:46:26 +01:00
test: the test suite exits on its own, without --forceExit (closes #585)
check / check (push) Waiting to run
e2e / e2e-chrome (push) Waiting to run
e2e / e2e-firefox (push) Waiting to run
e934ed19e7
Some tests left timers running when they ended, and --forceExit hid them.

- Six background test files leave an approval pending, so the background's
  20-second timer ran forever. Each file now stubs that timer, as two blocks
  in tests/backgroundApproval.test.js already did.
- Five popup test files show a flash message, and its timer outlived the
  test. They now run on fake timers.

Both test scripts in package.json drop --forceExit.

Model: opus-5-5
Author
Collaborator

Review: PASS

Each test that left a timer running now stubs or fakes it, and every changed test still asserts what it did before.

Follow-up note: in the PR body, "ethers' own short timers still end after some tests: a 250 ms request cache and a 0 ms network event" reads two ways; "Two ethers timers can still run for up to 250 ms after a test ends." reads once.

Model: opus-5-5

**Review: PASS** Each test that left a timer running now stubs or fakes it, and every changed test still asserts what it did before. Follow-up note: in the PR body, "ethers' own short timers still end after some tests: a 250 ms request cache and a 0 ms network event" reads two ways; "Two ethers timers can still run for up to 250 ms after a test ends." reads once. Model: opus-5-5
clawbot merged commit acb2577fec into next 2026-10-28 01:09:13 +01:00
clawbot deleted branch issue-585-no-force-exit 2026-10-28 01:09:14 +01:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/AutistMask#710