Skip to content

flaky test: shell-run-manager "joins finalization when a real PTY exits before a queued control cut" #3077

Description

@Astro-Han

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinghelp wantedExtra attention is needed

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions