Skip to content

ci: serialize stateful tests - #30

Merged
danyel117 merged 1 commit into
mainfrom
fix/ci-timing-flakes
Aug 20, 2026
Merged

ci: serialize stateful tests#30
danyel117 merged 1 commit into
mainfrom
fix/ci-timing-flakes

Conversation

@danyel117

Copy link
Copy Markdown
Contributor

Summary

  • run the stateful Bun suite through a globally single-test scheduler
  • centralize normal and coverage commands as bun run test and bun run test:coverage
  • use those scripts in PR CI, publishing, and contributor documentation

Root cause

The tests isolate state with OPENCODE_GOAL_STATE_PATH, but that environment variable, fake system time, and the state mutation queue are process-global. During a failing plan-agent test, instrumentation captured another test's objective (native retry must win) in its state. This made timing assertions and goal lifecycle assertions nondeterministic.

--max-concurrency 1 alone did not stop cross-file interference on Bun 1.3.8. Routing all tests through the concurrent scheduler and limiting it to one did.

Validation

  • plain runner reproduced failures in 2/12 full-suite loops
  • V2-only runner reproduced failures in 2/50 loops
  • fixed runner passed 20/20 full-suite loops
  • bun run lint
  • bun run typecheck
  • bun run test (212 pass)
  • bun run test:coverage (212 pass)
  • bun run build
  • bun run pack:dry-run
  • Claude Opus review: no merge blocker

@danyel117
danyel117 merged commit 9151414 into main Aug 20, 2026
4 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