Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: add temp cleanup sweep to mediaJobQueue test for Windows CI (#9046)

[._.]/ Adam Eivya14002a73be9
diff --git a/server/services/mediaJobQueue/index.test.js b/server/services/mediaJobQueue/index.test.js
index ea74346dd2..49b00290ea 100644
--- a/server/services/mediaJobQueue/index.test.js
+++ b/server/services/mediaJobQueue/index.test.js
@@ -219,6 +219,12 @@ afterEach(async () => {
if (tempDataDir && existsSync(tempDataDir)) {
rmSync(tempDataDir, { recursive: true, force: true });
}
+ // Windows holds file handles on terminating child processes longer than
+ // macOS/Linux, so a single rmSync above may not catch all temp dirs yet.
+ // Sweep the run's real tmpdir for any remaining mediaJobQueue-test-* dirs
+ // with retry delays. See #9046, #9032.
+ const { sweepStrayTempRoots } = await import('../../lib/mockPathsDataRoot.js');
+ await sweepStrayTempRoots('mediaJobQueue-test-');
});
describe('mediaJobQueue', () => {
diff --git a/server/test/runTempRoot.js b/server/test/runTempRoot.js
index 98bdc24a4e..69cdb69652 100644
--- a/server/test/runTempRoot.js
+++ b/server/test/runTempRoot.js
@@ -77,13 +77,7 @@ const VITEST_INTERNAL_SCRATCH_DIR = /^[A-Za-z0-9_-]{21}$/;
// first place. No longer allowlisted below; a recurrence is a real,
// unknown leak again.
-// A leak this file is NOT the right place to fix: `server/services/
-// mediaJobQueue/index.test.js` is a different work area, out of scope for
-// #9032 — seen leaking on a Windows CI shard. Tracked in #9046. Remove
-// this entry once #9046 lands.
-const KNOWN_PENDING_LEAKS = new Set([
- 'mediaJobQueue-test-',
-]);
+const KNOWN_PENDING_LEAKS = new Set([]);
/**
* Groups a leaked entry's basename by its mkdtemp call site as closely as a