Skip to content

test(ignore): pin cut timeout notice in report - #1434

Closed
WilliamK112 wants to merge 2 commits into
squirrelscan:mainfrom
WilliamK112:codex/ignore-timeout-controller-test-1419
Closed

WilliamK112 wants to merge 2 commits into
squirrelscan:mainfrom
WilliamK112:codex/ignore-timeout-controller-test-1419

Conversation

@WilliamK112

Copy link
Copy Markdown
Contributor

Summary

Closes #1419

Verification

  • npx -y [email protected] test apps/cli/tests/audit/ignore-timeout-cut-controller-1419.test.ts
  • npx -y [email protected] run --filter @squirrelscan/cli typecheck
  • node_modules/.bin/oxlint -c oxlint.config.mjs tests/audit/ignore-timeout-cut-controller-1419.test.ts
  • apps/cli/node_modules/.bin/oxfmt --check apps/cli/tests/audit/ignore-timeout-cut-controller-1419.test.ts

Checklist

  • I added or updated tests for behavioral changes.
  • I did not include secrets, customer data, or incompatible third-party material.
  • Every commit includes a DCO Signed-off-by line (git commit -s).

@WilliamK112
WilliamK112 force-pushed the codex/ignore-timeout-controller-test-1419 branch from 381e67e to 5777f30 Compare October 31, 2026 11:30
@nc9

nc9 commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Thanks for the controller-level test, it is a real addition: it fails when the retained list is reverted to [], passes 5 of 5 runs idle and under load, and uses only a local fixture.

One blocker before we can take it: the test uses mock.module on @/audit/max-duration and @/audit/adapter. Bun module mocks outlive the file, and CI runs apps/cli tests in one process, where this file sorts before max-duration.test.ts and audit-probe-wiring.test.ts. Run together, those two fail (4 failures and 9 timeouts); without your file they pass.

The fix is to use spyOn on the module namespaces and restore with mockRestore() in afterAll. That passes alone and combined (84 pass), and your mutation check still fails it. If you would like the exact patch, say so and we will post it. Otherwise we will carry the change on top of your commit, keeping your authorship.

nik

@WilliamK112

Copy link
Copy Markdown
Contributor Author

Thanks for catching the process-wide mock leakage. I replaced both mock.module overrides with namespace spyOn(...).mockImplementation(...) spies and restore each with mockRestore() in afterAll (e1da605).

Validated locally:

  • the focused controller test passes
  • the controller test together with max-duration.test.ts and audit-probe-wiring.test.ts: 64 pass, 0 fail
  • CLI typecheck and lint pass
  • repository-wide format check passes

nc9 commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Reviewed head: e1da605

Verdict: pending maintainer review. The earlier blocker looks addressed, but the CLI tests check is still running on this head.

Earlier requested change (replace mock.module with spyOn and restore):

  • Addressed. apps/cli/tests/audit/ignore-timeout-cut-controller-1419.test.ts:17-47 now uses spyOn on the @/audit/max-duration and @/audit/adapter namespaces, and afterAll calls mockRestore() on both spies (line 76-77). No mock.module remains.

Findings, most severe first:

  1. Open: the CLI tests job has not finished on this head. The combined-process failure from the earlier review only shows up there, so it needs a green run before this can be taken.
  2. Minor: durationBudget is shared module state and hardStopAt is written through a type cast (line 41). That is fine for a single test, but it would break if a second test is added to this file.
  3. Minor: the spies are installed at module top level, before beforeAll. They are restored in afterAll, so there is no leak, but moving the install into beforeAll would be more conventional.

Checks: format, lint and typecheck, DCO sign-off, changelog guard, secret scan, CodeQL and docs are green. Test-only change, one file, no new dependency, fixture is local (127.0.0.1).

nik

@nc9

nc9 commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Thanks, the spyOn isolation fixes it: your file now passes together with max-duration and audit-probe-wiring in every order we tried, the mutation (reverting the retained list to []) still fails it, and it was stable 5 of 5 idle and 6 of 6 under load. We will take it in the next release batch with your authorship kept.

nik

@nc9 nc9 mentioned this pull request Oct 31, 2026
@nc9

nc9 commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Landed in v0.0.151 as 7b074ed6 52879078 via #1446. Release: https://github.com/squirrelscan/squirrelscan/releases/tag/v0.0.151. Thank you William, the spyOn isolation fix made it, and the test now pins the cut timeout notice through the controller. Closing this original.

nik

@nc9 nc9 closed this Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[[ignore]]: a cut rules phase loses the 'ignore entry timed out' notice

2 participants