Skip to content

test(core): harden timing-sensitive process and project-copy tests - #48205

Closed
bunnysayzz wants to merge 1 commit into
anomalyco:devfrom
bunnysayzz:flaky-core-tests
Closed

bunnysayzz wants to merge 1 commit into
anomalyco:devfrom
bunnysayzz:flaky-core-tests

Conversation

@bunnysayzz

@bunnysayzz bunnysayzz commented Sep 9, 2026 •

Copy link
Copy Markdown

Issue for this PR

Closes #37321

Type of change

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

What does this PR do?

Fixes the two timing flakes from the CI run in #37321. Test-only changes, no product code touched.

  1. packages/core/test/process/process.test.ts: waitForFile returned the first successful read. The child writes the readiness file with writeFileSync, which creates the file before its contents land, so the helper could observe it right after creation and return "" (Expected: /^\d+$/ Received: ""). It now only returns once the file is non-empty, sleeping 10ms between attempts either way. All four call sites expect non-empty contents (PID regex twice, "settled" twice), so no legitimate empty read exists.

  2. packages/core/test/project-copy.test.ts: refresh ignores stale git worktree registrations runs two git worktree add calls plus a recursive remove on top of setup()'s git init, which blows the default live-test timeout on loaded Windows runners. Bumped to 15s with a comment saying why.

Prior attempt #37377 did the same two things but was closed unmerged without review; this re-applies them on current dev, where the flaky helper is still byte-identical to the version in the issue.

How did you verify your code works?

  • bun test test/process/process.test.ts in packages/core: 24 pass, repeated 3x, 0 fail.
  • bun test test/project-copy.test.ts in packages/core: 13 pass, repeated 3x, 0 fail.
  • bun typecheck in packages/core: clean.

Screenshots / recordings

Not a UI change.

Checklist

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

@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels Sep 9, 2026
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

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

@bunnysayzz

Copy link
Copy Markdown
Author

Rebased onto latest dev (was 12 behind, clean rebase, no conflicts). Re-verified after the rebase: process suite 24 pass, project-copy suite 13 pass.

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v2 tests: process and project-copy tests flake in CI

1 participant