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

test: isolate detached server surrogate from Vitest worker flags (#8850)

[._.]/ Adam Eivy5f67d29ba329
diff --git a/server/lib/detachedSpawn.test.js b/server/lib/detachedSpawn.test.js
index 8c1159b1b0..49490ce3bc 100644
--- a/server/lib/detachedSpawn.test.js
+++ b/server/lib/detachedSpawn.test.js
@@ -380,8 +380,13 @@ describe('spawnDetached', () => {
'setInterval(() => {}, 1000);',
].join('\n'));
+ // This is a standalone server surrogate, not a Vitest worker. Its real
+ // registry writes into the disposable install root above; inheriting
+ // VITEST would correctly trigger the test runner's real-data write guard.
+ const spawnerEnv = { ...process.env, PORTOS_DATA_ROOT: controlDir };
+ delete spawnerEnv.VITEST;
const spawner = spawn(process.execPath, [spawnerPath], {
- stdio: 'ignore', env: { ...process.env, PORTOS_DATA_ROOT: controlDir },
+ stdio: 'ignore', env: spawnerEnv,
});
const pidFile = join(controlDir, 'pid');
const readPid = async () => Number.parseInt(await readFile(pidFile, 'utf8').catch(() => ''), 10);