Repository navigation
test(jetbrains): fix flaky worktree fork dedupe test - #13947
Merged
Merged
Conversation
The dedupe test asserted the first fork RPC was recorded after pump(), but pump() only flushes the EDT. FakeSessionRpcApi.fork records the call on the background dispatcher before awaiting forkGate, so the assertion could run first and see no fork. Wait for the in-flight RPC with waitUntil before firing the duplicate, then flush() so an accidental second call would surface.
marius-kilocode
enabled auto-merge
September 9, 2026 07:51
eshurakov
approved these changes
Sep 9, 2026
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.
What Problem This Solves
The JetBrains CI job flaked in
WorktreeSessionEditorManagerTest > test a second fork of the same session is ignored while the first is in flightwithexpected:<1> but was:<0>atWorktreeSessionEditorManagerTest.kt:301.Why This Change Was Made
The test called
pump()afterforkSession()and then asserted the first fork RPC had been recorded.pump()only flushes the EDT.FakeSessionRpcApi.forkrecords the call on the background dispatcher before awaitingforkGate, so under load the assertion could run before the coroutine was scheduled and see zero forks.The fix waits for the in-flight RPC with the existing
waitUntilhelper before firing the duplicate, thenflush()so an accidental second call would surface. This matches the establishedGhStatusCoordinatorTest.awaitCalls(1)pattern for the same "first RPC is in flight" check.User Impact
None. Test-only change.
Evidence
./gradlew :frontend:testfrompackages/kilo-jetbrains/: 3884 tests pass.WorktreeSessionEditorManagerTestwithcleanTest: all pass.