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): make Windows-flaky shell and npm tests deterministic by kitlangton · Pull Request #46610 · anomalyco/opencode

Conversation

@kitlangton

@kitlangton kitlangton commented Sep 1, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Why

v2's Windows unit job has been red for most of today. Five of the last eight non-cancelled v2 runs failed there, and two Core tests account for most of it:

  • ShellTool > does not retain removed running shells in exit order failed in every one of those runs. After creating and removing 26 real shells, the final command does not settle within its two-second deadline. The regression from fix(core): prevent shell eviction loop #43650 concerns eviction bookkeeping, not shell startup speed.
  • npm.test.ts cases that run several real bun add child processes under Bun's default five-second watchdog. Locally the registry check/update case takes about 100 ms; on the Windows runner each spawn costs over a second, so whichever combined case gets the cold start times out (Npm.add Git installs in fix(core): rebuild registry state on read #46631's first runs, Npm.check and Npm.update in this PR's first run).

What Changes

Shell retention

Replace the process-churn test with eviction makes progress past an already-removed shell, exercising the real Shell.Service and file-backed output with a controlled Environment.spawner.

Before After
26 real running shells removed with 10 ms sleeps One removed shell followed by an explicitly delivered late exit
A two-second wait used as the liveness assertion Controlled completions joined through the full exit handler
Session/tool fixture for retention bookkeeping Direct Shell composition with isolated temporary directories

The test crosses the 25-entry retention cap, verifies that the oldest retained command is actually evicted, and checks that a subsequent command completes with intact output. It also preserves the missing-capture assertion for a removed command.

Joining the exit-handler fiber matters: Shell.wait resolves before the retention queue is updated, so waiting for the shell result alone is not a bookkeeping barrier. The fixture finalizes those fibers with its scope.

Npm installs

Split combined install stories into independent cases so each real install gets its own default deadline. No timeout is raised.

Before After
installs and resolves named and unnamed Git packages with dependencies (two cold installs) installs and resolves unnamed Git packages… and …named Git packages… via test.each
checks registry targets without mutation and explicitly updates mutable targets (mutable add, pinned add, update, no-op update) checks a mutable registry target without mutation and explicitly updates it plus never reports a pinned registry target as outdated

Every installation, cache, resolution, revision, dependency, and update assertion is preserved; the file keeps its 68 expect() calls across 15 tests instead of 13.

Scope

Test-only. The shell implementation, retention limit, and Npm runtime are unchanged. The ConfigInstructionPlugin … rescans them on change and Project.resolve > keeps the canonical project directory… Windows failures seen in the same v2 runs are not addressed here.

This is the root of a stack: #46682 (ACP activation wait) and #46631 (incremental State materialization) are based on it because the same Windows job blocked their CI.

Verification

Run locally on macOS with Bun 1.4.0:

# packages/core
bun typecheck
bun run test test/shell-retention.test.ts --rerun-each 1000
bun run test test/tool-shell.test.ts test/shell.test.ts test/effect/cross-spawn-spawner.test.ts
bun run test test/npm.test.ts --rerun-each 5
bun run test test/npm.test.ts --test-name-pattern 'installs and resolves .* Git packages' --rerun-each 10

# Repository root
bunx prettier --check packages/core/test/shell-retention.test.ts packages/core/test/tool-shell.test.ts packages/core/test/npm.test.ts
git diff --check
  • Shell retention regression: 1,000/1,000 passed in 12.61 seconds; related real-shell and spawner suites 105 passed, 19 skipped, 0 failed.
  • Npm suite: 75/75 passed across 5 repetitions, 340 assertions; the Git install pair 20/20 across 10 repetitions. Split registry cases run in 266 ms and 40 ms locally.
  • Core typecheck, formatting, and whitespace checks passed; the unmodified pre-push hook passed all 33 repository typecheck tasks.
  • Mutation check on the shell test: temporarily restoring the original early return before stale exit-order removal made the new test fail at the runner's five-second watchdog after its removed-capture assertion; restoring the fix made it pass. No mutation is included in the diff.
  • On this PR's first CI run the new shell-retention test passed on Windows while the combined registry check/update case timed out, which is what prompted the npm split. Native Windows verification of the split is left to CI.

Stack

  1. test(core): make Windows-flaky shell and npm tests deterministic #46610 👈 current
  2. fix(cli): await plugin activation before caching ACP catalog #46682
  3. fix(core): rebuild registry state on read #46631

Sorry, something went wrong.

Uh oh!

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

All reactions
@github-actions github-actions Bot added the contributor label Sep 1, 2026
This was referenced Sep 1, 2026
feat(core): support strict plugin activation waits #46615
Closed
feat(sdk): configure session-selected instances #46496
Merged
fix(core): rebuild registry state on read #46631
Closed
@kitlangton
test(core): make shell retention regression deterministic
6f6886c
@kitlangton
kitlangton force-pushed the shell-retention-test branch from 3267c66 to 6f6886c Compare September 1, 2026 21:17
@kitlangton kitlangton mentioned this pull request Sep 1, 2026
fix(cli): await plugin activation before caching ACP catalog #46682
Merged
@kitlangton
test(core): isolate slow npm install cases
9bd30fc
Run the named and unnamed Git installs, and the mutable and pinned registry check/update paths, as independent cases instead of several real installs under one default watchdog. Each bun add child process costs over a second on the Windows runner, so the combined cases regularly exceeded five seconds there. All installation, cache, resolution, revision, dependency, and update assertions are preserved; deadlines are unchanged.
@kitlangton kitlangton changed the title test(core): make shell retention regression deterministic test(core): make Windows-flaky shell and npm tests deterministic Sep 1, 2026
@kitlangton
kitlangton merged commit 7f2645a into v2 Sep 2, 2026
14 checks passed

Uh oh!

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

@kitlangton
kitlangton deleted the shell-retention-test branch September 2, 2026 00:45
This was referenced Sep 2, 2026
fix(core): copy models.dev snapshot without structuredClone #46710
Merged
chore(tui): upgrade OpenTUI to 0.5.10 #46626
Merged
fix(core): rebuild registry state on read #46725
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

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

Assignees

No one assigned

Labels

contributor

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

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

1 participant

@kitlangton
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.