Repository navigation
test(daemon): import fresh daemon-init modules one at a time - #34085
Merged
Merged
Conversation
nwparker
marked this pull request as ready for review
October 26, 2026 21:20
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 2 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
nwparker
force-pushed
the
nwparker/daemon-init-fresh-import-order
branch
from
October 26, 2026 21:47
df971b1 to
ab8b570
Compare
Parallel dynamic imports right after vi.resetModules made the cold first test in daemon-init-provider-installation order-dependent: it failed on every CI run that placed the file in unit shard 4.
nwparker
force-pushed
the
nwparker/daemon-init-fresh-import-order
branch
from
October 26, 2026 21:53
ab8b570 to
15318e8
Compare
7 of 9 tasks
This was referenced Oct 26, 2026
Jinwoo-H
pushed a commit
to thefrikidude/orca
that referenced
this pull request
Oct 27, 2026
…blyai#34085) Parallel dynamic imports right after vi.resetModules made the cold first test in daemon-init-provider-installation order-dependent: it failed on every CI run that placed the file in unit shard 4.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
ELI5
One daemon start-up unit test failed on every CI run that put it in test shard 4/5, and with today's file list that's every PR that doesn't add or remove a test file. This makes the test's setup import its modules in a fixed order, which makes it pass there.
What Changed
Before:
importFreshDaemonInit(the shared setup for the daemon-init tests) calledvi.resetModules()and then started four dynamic imports at once withPromise.all. On CI shard 4, "re-binds listeners after the first daemon provider is installed" failed 4 out of 4 times across two unrelated PRs (#33102, #33839):setLocalPtyProviderwas called 0 times, even though init returned normally.After: the four modules (
daemon-provider-init,-restart,-state,daemon-protocol-cleanup) are imported one after another. Each one evaluates against the freshly reset, fully mocked module graph in a fixed order. Shard 4 passed on this branch (run 40404219946, job 121859327924, file confirmed in shard 4/5). The assertions are unchanged.Why
resolveMocks(), which takes the queuedvi.mockids and clears the queue before it awaits their resolution. The module fetch only waits for mocks while that queue is non-empty. So when the imports run concurrently, the other three fetch their dependencies while the mocks are still unregistered.daemon-provider-statecan then bind the real../ipc/pty/provider/registry, soinstallDaemonProviderruns but the mock records 0 calls. Only the first test in the file is exposed, because the queue is only filled before the first import, and whether it fails depends on how slow that round trip is (CI shard load).Linked Issue
N/A (main break: shard-4 unit failure blocking PRs).
Visual Proof
N/A: test-only change.
Testing
CI shard 4/5 on this branch: daemon-init-provider-installation.test.ts passes (16 tests).
pnpm tc:nodeand oxlint pass.I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Review
Agent skill upstream boundary
Notes
Test-only. There's no runtime, SSH, mobile or wire impact.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)