fix(desktop): stabilize flaky DM expansion E2E ordering assertions#2004
Open
cameronhotchkies wants to merge 1 commit into
Open
fix(desktop): stabilize flaky DM expansion E2E ordering assertions#2004cameronhotchkies wants to merge 1 commit into
cameronhotchkies wants to merge 1 commit into
Conversation
The DM expansion flow issues multiple async commands (open_dm, create_managed_agent, start_managed_agent) whose completion order is non-deterministic without artificial delays. Three tests at lines ~760, ~815, and ~940 lacked the delay guards that the test at line ~652 already used, causing intermittent CI failures when command-log ordering assertions ran against a race. Add createManagedAgentDelayMs or openDmDelayMs (100ms) to the affected tests to guarantee deterministic command ordering. Also move the popover-hidden assertion in the line-652 test to after the chat-title assertions, where the UI has fully settled. Co-authored-by: Cameron Hotchkies <chotchkies@block.xyz> Signed-off-by: Cameron Hotchkies <chotchkies@block.xyz> Co-authored-by: Goose <opensource@block.xyz> Ai-assisted: true
cameronhotchkies
force-pushed
the
fix/flaky-dm-expansion-e2e-ordering
branch
from
July 17, 2026 17:34
2bb310e to
ca3ab52
Compare
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.
Summary
Fixes 4 flaky DM expansion E2E tests in Desktop Smoke shard 1 that were failing non-deterministically on CI (also reproducing on
mainat run29526844596).Failing tests:
channels.spec.ts:652— creates the DM before preparing a persona mentionchannels.spec.ts:760— routes an agent mention from an existing DM to the expanded conversationchannels.spec.ts:815— routes a relay-agent mention from an existing DM to the expanded conversationchannels.spec.ts:940— drops an expanded DM after the first message failsRoot Cause
Race condition: under fast CI execution, mock command completions (create_managed_agent, open_dm) can resolve in non-deterministic order, causing assertions to observe stale or mid-transition state.
Fix
new-message-recipient-popoverhidden assertion afterchat-titlesettles (both names present), so it runs post-transition rather than mid-transition.createManagedAgentDelayMs: 100to ensure persona provisioning doesn't collapse into the same tick as the expanded-DM open/start sequence.openDmDelayMs: 100so the two open_dm calls resolve in deterministic order.Validation
All 4 tests pass with
--repeat-each=3(12/12 green) locally. Biome lint clean.Scope
Test-only change: 12 insertions, 1 deletion in
desktop/tests/e2e/channels.spec.ts.Investigated by Ferret, reviewed by Grumplestiltzkin.