Skip to content

fix(test): widen more subprocess/eventual-consistency timeouts causing flaky unit failures - #202

Closed
alltomatos wants to merge 5 commits into
devfrom
claude/fix-pr-test-errors-082173
Closed

alltomatos wants to merge 5 commits into
devfrom
claude/fix-pr-test-errors-082173

Conversation

@alltomatos

@alltomatos alltomatos commented Sep 12, 2026 •

Copy link
Copy Markdown
Owner

Issue for this PR

Closes #163

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Same class of issue as #163 / #162 (widened subprocess timeouts to match CI-load cold-start headroom), recurring with three different tests, confirmed by inspecting recent test workflow failures on dev and other branches via gh run view --log-failed:

  • run-process.test.ts: --format json emits a pure error record for a rejected prompt request outer bound was 30s, tighter than the harness's own 60s subprocess timeout default (test/lib/cli-process.ts) — bumped to 60s. Observed a 30060ms failure on 2026-09-12.
  • prompt.test.ts: loop waits while shell runs and starts after shell exits bound was 10s; cold-start variance on a spawned sleep 0.2 child process pushed it past that under CI load — bumped to 30s, matching sibling subprocess-spawning tests in the same file. Observed 10000.96ms.
  • workspace.test.ts: the local eventuallyEffect poll helper's default timeout was 1500ms; workspace sync status transitions (e.g. detecting a missing target directory) can take longer to propagate under CI load — bumped default to 5000ms. Observed a 16875ms failure.

All three bumps add headroom rather than shave to the exact observed miss, so a genuine hang still fails loudly. The global bun test --timeout 60000 bound is unaffected and still bounds worst case.

Also confirmed the "tui plugin timed out cleaning up" lines that show up in nearly every CI log are just a runtime warning (src/plugin/tui/runtime.ts), not a test failure — no change needed there.

How did you verify your code works?

  • bun test test/cli/run/run-process.test.ts -t "emits a pure error record" — pass
  • bun test test/session/prompt.test.ts -t "loop waits while shell runs and starts after shell exits" — pass
  • bun test test/control-plane/workspace.test.ts -t "reports error when the target directory is missing" — pass
  • Full suite for the three affected files together: 108 tests, 92 pass / 16 skip / 0 fail
  • bun turbo typecheck — all 30 packages pass (ran automatically on push via hook)

Screenshots / recordings

N/A (test-only change, no UI impact).

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

🤖 Generated with Claude Code

…g flaky unit failures

Same class of issue as #191, recurring with a different set of tests
under CI load:

- run-process.test.ts: "--format json emits a pure error record for a
  rejected prompt request" (30s->60s) — outer bound was tighter than
  the harness's own 60s subprocess timeout default (test/lib/cli-process.ts),
  so CI-load variance tripped the test timeout before the subprocess
  itself could time out. Observed 30060ms on 2026-09-12.
- prompt.test.ts: "loop waits while shell runs and starts after shell
  exits" (10s->30s) — cold-start variance on a spawned "sleep 0.2"
  child process could push this past a 10s bound; other subprocess
  instance tests in this file already use 30s. Observed 10000.96ms.
- workspace.test.ts: eventuallyEffect default poll timeout (1500ms->5000ms)
  — workspace sync status transitions (e.g. detecting a missing target
  directory) can take longer than 1.5s to propagate under CI load.
  Observed a 16875ms failure on 2026-09-12.

All widened with headroom rather than shaved to the exact observed
miss, so a genuine hang still fails loudly. Verified: all three tests
pass individually, and the full workspace/prompt/run-process suites
(108 tests) pass together.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@github-actions

Copy link
Copy Markdown

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions

Copy link
Copy Markdown

Thanks for updating your PR! It now meets our contributing guidelines. 👍

alltomatos added a commit that referenced this pull request Sep 13, 2026
…163)

Port fix from #202:
- Bump eventuallyEffect timeout in workspace.test.ts from 1500ms to 5000ms
  to provide headroom for workspace sync transitions and SSE events under load.
- Bump subprocess timeout in run-process.test.ts from 30s to 60s matching
  the test harness default.
Resolves conflicts in run-process.test.ts, workspace.test.ts, and
prompt.test.ts: dev already landed an equivalent/superset fix for the
same timeout issue via #163 (explicitly "port fix from #202") and a
follow-up prompt.test.ts timeout widen — kept dev's versions since
they're functionally identical or better (same 60s/30s/5000ms values,
plus dev's own additional widened prompt-shell-loop timeouts).

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@alltomatos

Copy link
Copy Markdown
Owner Author

Closing as superseded: all timeout headroom adjustments already landed on dev via commit a2125e3 (#163) and PR #210 (diff against dev is 0).

@alltomatos alltomatos closed this Sep 13, 2026
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.

fix(ci): flaky subprocess timeouts in unit tests (linux/windows)

1 participant