test: prefer shared temp dir helpers in auto-reply and install-fallback tests#96048
Closed
xialonglee wants to merge 1 commit into
Closed
test: prefer shared temp dir helpers in auto-reply and install-fallback tests#96048xialonglee wants to merge 1 commit into
xialonglee wants to merge 1 commit into
Conversation
…ck tests Replace raw fs.mkdtemp/mkdtempSync calls with createSuiteTempRootTracker() for automatic cleanup and consistent temp directory management. - session-hooks-context.test.ts: mkdtemp in helper leaked temp dirs - abort.test.ts: createAbortConfig mkdtemp returned root without cleanup - inbound.test.ts: two test cases created temp dirs without cleanup - install-fallback.test.ts: workspaceDir variable could be overwritten Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
~100+ test files still use raw
fs.mkdtemp/fs.mkdtempSyncinstead of the shared temp directory helpers insrc/test-helpers/temp-dir.ts. This causes:scripts/report-test-temp-creations.mjs) already warns against new raw mkdtemp callsWhy This Change Was Made
The project has shared helpers (
createSuiteTempRootTracker,withTempDir) since commit 88b87d8 that handle automatic cleanup with retries. This PR migrates the first batch of high-risk files that have zero cleanup.User Impact
Evidence
createSuiteTempRootTracker()with properbeforeAll/afterAllcleanupFiles Changed
src/skills/lifecycle/install-fallback.test.tscreateSuiteTempRootTracker()src/auto-reply/reply/session-hooks-context.test.tscreateSuiteTempRootTracker()src/auto-reply/reply/abort.test.tscreateSuiteTempRootTracker()src/auto-reply/inbound.test.tscreateSuiteTempRootTracker()