Skip to content

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

Merged
ualtinok merged 1 commit into
mainfrom
test/fence-process-start
Nov 23, 2026
Merged

ualtinok merged 1 commit into
mainfrom
test/fence-process-start

Conversation

@antauth-alfonso

@antauth-alfonso antauth-alfonso Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

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.

Written for commit 31aaf61. Summary will update on new commits.

View guided diff Turn on auto-fix

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

The fixture's clock is fixed in January 2026, but the reused-pid check fell back to the real process table. On a machine where pid 200 is a real process (it started after the fixture's timestamps), five tests saw a live fake writer as a reused pid and the fence opened. Inject the start-time lookup like layout-fence.test.ts does.
@ualtinok
ualtinok merged commit be876a5 into main Nov 23, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant