test(cursor): remove per-file temp HAPI homes after cursor-models suites - #1269
Merged
Merged
Conversation
Follow-up to tiann#1268. The per-file `mkdtempSync`/`join(tmpdir(), ...)` HAPI homes in the cursor-models test cluster were never removed, so every run leaked a directory into the system temp dir (afterEach only cleared the cache file inside them). Save/restore HAPI_HOME and recursively remove each per-file temp root in teardown across all three cursor-models test files (cursorModels, cursorModelsSharedCache, and the stale-lock test that had the same pattern). No source/runtime change. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Findings
- No Blocker, Major, Minor, or Nit issues found in the added or modified lines.
Summary
Review mode: initial
- Reviewed the complete latest diff across the three cursor-model test files. The teardown order restores HAPI_HOME after cache resets and removes only the suite-owned temporary roots.
- Residual risk: filesystem cleanup behavior remains dependent on platform-specific temp-directory semantics; the repository CI test job was still in progress when reviewed.
Testing
- Not run (automation; PR code was not executed under the review security policy). GitHub test check: in progress.
HAPI Bot
Collaborator
Author
|
Fast-follow to close the HAPI Bot [Minor] on #1268 - temp-dir cleanup, bot re-review is Findings:None. Merging this one too under the low-impact arrangement. |
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.
Fast-follow to #1268 addressing the HAPI Bot
[Minor]finding on that PR.What / why
The per-file HAPI homes created by the cursor-models test cluster were never removed, so every run leaked a directory into the system temp dir (
afterEachonly cleared the cache file inside them). Over many runs this litters/tmpwithhapi-cursor-models-*dirs.This restores the previous
HAPI_HOMEand recursively removes each per-file temp root in teardown:cursorModels.test.ts-afterAllrestore +rmSync(the file the bot flagged)cursorModelsSharedCache.test.ts-afterAllrestore +rmSync(the file the bot flagged)cursorModelsStaleLock.test.ts- same latent leak (join(tmpdir(), 'hapi-cursor-models-lock-<pid>')was never cleaned) - folded in so the whole cluster is leak-freeNo source/runtime change - test hygiene only.
Verification
bun typecheckclean (cli+web+hub)./tmp: 0 leakedhapi-cursor-models-*dirs after each run (before the fix, one dir leaked per run per file).The one unrelated
runner.integration.test.tsfailure on my machine reproduces identically on pristineupstream/main(live-runner-daemon collision, environment-specific) and passed in CI on the #1268 merge commit - not touched by this diff.Made with Cursor