Repository navigation
test: restore Shell and GrowthBook module mocks after BashTool sandboxAnalysis tests - #2336
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📜 Recent review details
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
jatmn
left a comment
There was a problem hiding this comment.
— jatmn's PR Review agent
🟢 Thanks for the contribution. I do not see any actionable issues from my review.
Merge readiness
Merge-base decision is live-base-three-dot on main at c823efe56ae380e5c479855da22300d829451d48 through head 8eadf37b2cc65df5d372c0e8e7f20b67aa63b6bb. The branch is not behind main (behind_default_count 0). GitHub reports mergeable with mergeable_state blocked only while required checks were finishing; on the pinned head, PR Checks (smoke-and-tests, unit-tests shards 1–8, dedicated-tests, typecheck, launcher jobs, pr-intent-scan) and CodeQL (aggregate, javascript-typescript, actions) all completed successfully.
This is a surgical TA-001 test-hygiene slice: one file, no dependency on other open PRs, and scripts/run-tests.ts still passes --isolate on head. The PR body correctly describes a prerequisite for later isolate removal, not TA-001 completion.
Findings
No verified defects in the review range.
Summary
BashTool.sandboxAnalysis.test.tsnow snapshots the realutils/Shell.jsandservices/analytics/growthbook.jsmodules (nonce-qualified imports, the sameREAL_*pattern asmodel.test.tsx) and re-registers them for every mocked specifier inafterAll.mock.restore()does not undomock.module, so the stubbedexec(always{ code: 0, interrupted: false }) leaked into later files in the same process. Any order that ran this file beforeBashTool.errorOutput.test.tsmade errorOutput fail ("expected ShellError").Impact
--isolateneeds (TA-001).Testing
bun run buildok,bun run typecheckok,bun run checkok (0 failures in every shard).bun test --randomize --seed=$s src/tools/BashTool/*.test.tsfor seeds 1-20: 20/20 pass with this change; on current main seeds 1, 4, 6, 11 and 13 all fail (10/20 seeds failed overall before the fix).BashTool.errorOutput.test.tsalone: 50/50 pass on main, 20/20 pass while another test run loads the machine, so itssleep 5abort tests have no remaining timing race.Notes
Summary by CodeRabbit