martha#340: the in-flight case removes its tree only once its session is empty; pids are read whole #357

Manually merged
terra merged 1 commit from saturnus/340-clean-install-flake into main 2026-12-01 13:00:53 +00:00
Member

Purpose (fix): the installer job's clean-install file no longer goes red on a tree its own in-flight case leaves behind, and no longer reads a start's pid before it is written.

Refs #340 (the cause and the counts are in the latest comment there)

  • thePidIn: a start's pid is read once its whole line is in the file. The redirect makes the file before printf writes it, so under load the old read gave 0. The three cases that read a pid use it.
  • In-flight case: the tree is removed in the case's own after-hook, only once the run's session is empty. Before, the scratch hook ran first, and the writer's mkdir -p made the tree again.
  • The case asserts the session is empty after the tear-down.
  • Test only, one file. No timeout raised, no retry, no new check.
  • msi00, the installer job's image, 4 at once, the case alone: main 12 red in 480, this tip 0 in 480. Whole file, 3 × 8: 23/24 on both. The red is #356's class, not this change.
  • Whole npm test in its own namespace is green on the rerun (installer 169/169, src 5921, 0 fail). The first run was red only on #355 (approve).
  • Split out: #355 (approve ETIMEDOUT) and #356 (a forked child escapes killEvenIfGone).
Purpose (fix): the installer job's clean-install file no longer goes red on a tree its own in-flight case leaves behind, and no longer reads a start's pid before it is written. Refs #340 (the cause and the counts are in the latest comment there) - `thePidIn`: a start's pid is read once its whole line is in the file. The redirect makes the file before `printf` writes it, so under load the old read gave 0. The three cases that read a pid use it. - In-flight case: the tree is removed in the case's own after-hook, only once the run's session is empty. Before, the `scratch` hook ran first, and the writer's `mkdir -p` made the tree again. - The case asserts the session is empty after the tear-down. - Test only, one file. No timeout raised, no retry, no new check. - msi00, the installer job's image, 4 at once, the case alone: main 12 red in 480, this tip 0 in 480. Whole file, 3 × 8: 23/24 on both. The red is #356's class, not this change. - Whole `npm test` in its own namespace is green on the rerun (installer 169/169, src 5921, 0 fail). The first run was red only on #355 (approve). - Split out: #355 (approve ETIMEDOUT) and #356 (a forked child escapes killEvenIfGone).
Reproduced on msi00 in the installer job's image (node:24-trixie, the runner user, tini -s, git 2.56.1), 4 containers
at once, the in-flight case alone: 12 red in 480 runs.
- The pid file was read as soon as it existed: the redirect makes it before printf writes, so the read gave 0. thePidIn
  waits for the whole line; the three cases that read a start's pid use it.
- The scratch hook removed the tree before the kill hook ran, and the writer's `mkdir -p` made it again: the file then
  failed on martha-clean-install-test-*/relay/wrote with every case green (CI run 6155). The tree now goes in the
  case's own after-hook, once nothing is left in the run's session, and the case asserts that session empty after the
  tear-down.
After: 480 green in 480, nothing left behind.

Refs #340
terra manually merged commit 060679dec2 into main 2026-12-01 13:00:53 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
martha-ai/martha!357
No description provided.