Test: settings fence tests never ask the OS about their fake pids

Merged
AN
2h ago
+5-0

Five tests in packages/core/src/tests/settings-move-fence.test.ts failed on parity CI run 45231373628 with the fence open instead of closed. The fixture clock is fixed at 2 Jan 2026, but its liveness object had no processStartedAtMs, so the reused-pid check in layout-fence.ts asked the real process table about fake pid 200. Wherever pid 200 is a real process, it started after the fixture timestamps, so the live fake writer looked like a reused pid.

Proof: with the injected lookup returning a start after the fixture times, exactly those five tests fail, matching CI. With null (unknown, as layout-fence.test.ts injects), all 40 pass. Test-only change.

Other fixtures that don't inject the lookup (settings-move-run.test.ts) use the real clock, so a real process can't look newer than a file the test just wrote.


Summary by cubic

Fixes flaky fence tests that failed when a fake pid happened to be a real process on the test machine.

  • settings-move-fence.test.ts now injects a start-time lookup returning null so the reused-pid check never asks the OS about fake pids.
  • The fixture clock is fixed in January 2026, but a real process started after those timestamps made a live fake writer look like a reused pid, opening the fence in five tests.

RetriggerView in GreptileConfidence Score: 5/5

The test-only change appears safe to merge.

Summary

Makes the settings-fence tests independent of real processes that happen to share their fake pids.

  • Settings-fence tests keep fake PIDs separate from real process start times.

Reviews (1) · Last reviewed commit: "Test: settings fence tests never ask the..." · Reviewed by Greptile