GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test(core): fix Windows unit flakes in video, shell, and session-tabs tests by neriousy · Pull Request #64875 · anomalyco/opencode

Conversation

@neriousy

@neriousy neriousy commented Nov 19, 2026 •
edited by opencodejr Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Issue for this PR

Closes #

Type of change

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

What does this PR do?

Fixes five unit (windows) failures from recent dev pushes.

  • experimental_video_generate > starts the job… (job 135243433317, timed out after '10s'). VideoGeneration checks jobs every 5s and wait polls every 5s, both on the real clock. Under it.live the notice can take up to two intervals plus the work, which is more than the test's 10s wait. The test now runs under it.effect and steps the TestClock with advance until the notice arrives. It takes 0.6s now, down from 5.8s locally.
  • Session.shell > runs shells concurrently… (job 134208260084, timed out after '5s' in the first launch). Session.shell waits for the Location's cold plugin activation before it spawns, and that happened inside launch's 5s waits. Locally the first launch took 1.66s, about 1.4s of it activation. Windows runs 5-9x slower. setup now waits for activation under the 30s test timeout, so each 5s wait covers only the shell. The first launch now takes 0.29s locally.
  • empties legacy persisted unread records… (tui, same job). writeJsonAtomic failed with EPERM on rename, because Windows won't rename onto a file another reader has open. In the test that reader is the 10ms file poll. In real use it is another TUI reloading tabs.json. The write was dropped and the test timed out. This is a product bug, so writeJsonAtomic now retries the rename on EPERM/EACCES/EBUSY (20 × 10ms). That matches the cli's service-file fix (fix(cli): retry service file renames on Windows #59105).
  • ShellTool stopped > says once that a stopped command wrote nothing (spawned) (job 133685231898). After a stop, the call waits only INTERRUPT_WAIT (500ms) for the kill. If the kill takes longer, the message ends in "; it is still being stopped". This test cancels right after pwsh starts, so the Windows kill went past 500ms. The product behaves as designed: the test was checking wall-clock speed. It now checks the "no output" wording with or without that suffix.
  • util.effect-flock > enforces mutual exclusion under process contention (job 133772018173). One worker exited 1. The test checked exit codes before stderr, so the log never showed why. There isn't enough evidence to fix this yet, so this PR only swaps the two assertions (the unit-tests skill calls this out). The next failure will print the cause.
  • Git > clones a remote and reads checkout metadata (job 132598970817): not changed. In the fixture, git push -u origin main printed [new branch] main -> main, then failed to push some refs, with no rejection reason. Most likely the local receive-pack exited non-zero after updating the ref. This happened once in 133 saved job logs, and that's too little to pick a fix.

No flag: test and Windows-only reliability changes.

How did you verify your code works?

From packages/core, using bun run script/test.ts:

  • tool-video-generate.test.ts --rerun-each 10: passed
  • session-shell.test.ts --rerun-each 5: passed
  • tool-shell.test.ts -t "ShellTool stopped": passed
  • util/effect-flock.test.ts: passed

From packages/tui: session-tabs, persistence and storage tests passed.

bun typecheck passed in core and tui, and bun run check passed at the root. I couldn't reproduce the Windows rename and kill timing on macOS, so the Windows CI run is the real test for those two.

Checklist

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

Added by the opencode bot (AI-generated).

Fixes #61119

Related: #51470

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
neriousy added 2 commits November 19, 2026 14:34
@neriousy
test(core): stop Windows timing races in video, session shell and she…
beceeb5
…ll stop tests
@neriousy
fix(tui): retry storage renames that Windows refuses while the file i…
3438c85
…s read
opencodejr[bot]
opencodejr Bot reviewed Nov 19, 2026
View reviewed changes

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found nothing that blocks this. I ran the touched core tests on Linux, including 5× reruns of the video and session-shell tests, plus the tui session-tabs/persistence/storage tests, and they pass. The Windows rename and kill timing can't be reproduced here, so the Windows CI run is still the real test. The only failure, effect-flock > fails on unwritable lock roots, happens because the sandbox runs as root and fails the same way on the base. I couldn't run the type check: the packages' typecheck script needs bun check, which this sandbox's Bun doesn't have.

Public API: unchanged. The writeJsonAtomic retry only changes internal behaviour and keeps the same file format.

The retry in writeJsonAtomic also covers #61119 (lost session.json writes on Windows EPERM). The open PR #62691 makes the same change, so one of the two can be closed.

Fixes #61119
Related: #51470

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@neriousy
neriousy merged commit 354afc4 into dev Nov 19, 2026
13 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@neriousy
neriousy deleted the core-test-flakes branch November 19, 2026 13:47
@opencodejr opencodejr Bot mentioned this pull request Nov 19, 2026
refactor(core): search runs in the environment of the path it resolved #64814
Merged
@kitlangton kitlangton mentioned this pull request Nov 19, 2026
test(core): drive the video tool test with a test clock #64816
Closed
@Edo771977 Edo771977 mentioned this pull request Nov 19, 2026
chore: merge upstream/dev into the fork Edo771977/opencode#93
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@opencodejr opencodejr[bot] opencodejr[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

fix(tui): retry writeJsonAtomic on transient EPERM rename collisions on Windows

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@neriousy
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.