mirror of
https://github.com/wu736139669/hapi.git
synced 2026-11-25 05:07:05 +00:00
test(cursor): remove per-file temp HAPI homes after cursor-models suites (#1269)
Follow-up to #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>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { existsSync, mkdirSync, writeFileSync } from 'node:fs';
|
||||
import { existsSync, mkdirSync, rmSync, writeFileSync } from 'node:fs';
|
||||
import { join } from 'node:path';
|
||||
import { tmpdir } from 'node:os';
|
||||
import { afterEach, describe, expect, test, vi } from 'vitest';
|
||||
@@ -46,6 +46,9 @@ describe('listCursorModels stale ACP lock', () => {
|
||||
} else {
|
||||
process.env.HAPI_HOME = previousHome;
|
||||
}
|
||||
// Remove the per-file temp home so runs don't leak dirs into the system
|
||||
// temp dir (the test creates it under tmpdir() but never cleaned it up).
|
||||
rmSync(testHome, { recursive: true, force: true });
|
||||
});
|
||||
|
||||
test('runs cold ACP probe after clearing a stale cross-process lock', async () => {
|
||||
|
||||
Reference in New Issue
Block a user