joins finalization when a real PTY exits before a queued control cut in packages/runtime/src/__tests__/shell-run-manager.test.ts fails intermittently on CI.
Observed:run 31888796400, test_workspaces. assert.strictEqual expected completed and got running. The case took 2.8s; the enclosing ShellRunProcessManager suite took 33.6s. It surfaced on #3075, which touches three apps/desktop renderer files and does not change packages/runtime at all — that workspace is selected because it is upstream of apps/desktop. Re-running the same commit passed with no code change.
Suspected cause: the case spawns a real PTY and asserts on the run state after the process exits ahead of a queued control cut. Under CI load the finalization join has not landed by the time the assertion reads the state, so it still observes running. A fix would wait for the run to reach a terminal state rather than assume finalization completes inside the same window.
Whether the production join is genuinely racy or only the test's wait is unsound is a question for whoever owns the ShellRunProcessManager finalization contract — this issue deliberately does not assume it is test-only. #2978 was a different flaky case in the same file and did turn out to be test-only, but that is not evidence about this one.
joins finalization when a real PTY exits before a queued control cutinpackages/runtime/src/__tests__/shell-run-manager.test.tsfails intermittently on CI.Observed:run 31888796400,
test_workspaces.assert.strictEqualexpectedcompletedand gotrunning. The case took 2.8s; the enclosingShellRunProcessManagersuite took 33.6s. It surfaced on #3075, which touches threeapps/desktoprenderer files and does not changepackages/runtimeat all — that workspace is selected because it is upstream ofapps/desktop. Re-running the same commit passed with no code change.Suspected cause: the case spawns a real PTY and asserts on the run state after the process exits ahead of a queued control cut. Under CI load the finalization join has not landed by the time the assertion reads the state, so it still observes
running. A fix would wait for the run to reach a terminal state rather than assume finalization completes inside the same window.Whether the production join is genuinely racy or only the test's wait is unsound is a question for whoever owns the
ShellRunProcessManagerfinalization contract — this issue deliberately does not assume it is test-only. #2978 was a different flaky case in the same file and did turn out to be test-only, but that is not evidence about this one.