Found during Slock task #147 investigation (unrelated to the flakes, structurally real).
packages/runtime-host/src/control/endpoint.ts:4:
const POSIX_ENDPOINT_ROOT = '/tmp'; // hardcoded, ignores os.tmpdir()
Two problems:
- The parallel test runner assigns each workspace an isolated TMPDIR (run-workspace-tests-parallel.mjs:87) — this path bypasses it.
removeStaleEndpointDirectories() (endpoint.ts:94) deletes ALL /tmp directories matching the same rootId prefix before each host start. Measured up to 6 concurrent m-<uid>-… endpoint dirs during a parallel run. Two hosts with the same rootId starting concurrently: the later one deletes the earlier one's live socket directory. Tests currently survive only because each withHostPaths uses a distinct mkdtemp rootId — safety by coincidence, not by design.
Ask: read os.tmpdir() (honoring TMPDIR), and scope stale-cleanup to provably-dead directories (pidfile/lock heuristic) rather than same-prefix sweep.
Found during Slock task #147 investigation (unrelated to the flakes, structurally real).
packages/runtime-host/src/control/endpoint.ts:4:Two problems:
removeStaleEndpointDirectories()(endpoint.ts:94) deletes ALL /tmp directories matching the same rootId prefix before each host start. Measured up to 6 concurrentm-<uid>-…endpoint dirs during a parallel run. Two hosts with the same rootId starting concurrently: the later one deletes the earlier one's live socket directory. Tests currently survive only because eachwithHostPathsuses a distinct mkdtemp rootId — safety by coincidence, not by design.Ask: read os.tmpdir() (honoring TMPDIR), and scope stale-cleanup to provably-dead directories (pidfile/lock heuristic) rather than same-prefix sweep.