Skip to content

Fix the send progress test race on iOS - #1117

Merged
ivanfenenko merged 1 commit into
mainfrom
fix/ios-flaky-session-tests
Nov 23, 2026
Merged

ivanfenenko merged 1 commit into
mainfrom
fix/ios-flaky-session-tests

Conversation

@ivanfenenko

@ivanfenenko ivanfenenko commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Fixes a race in the iOS test sendPrompt_attachmentInFlight_showsSendingPercent.

When a send is accepted, the composer clears its progress first. The running status then reaches the screen through the session status stream, which is asynchronous. Until it lands, the turn pill's normal settle hold keeps the last label, Sending 25%. The test asserted the label immediately after sendPrompt returned, so it failed whenever the status arrived late. It now waits for the label to leave Sending.

This is a test-only change. The hold is the pill's documented behavior, so product code is unchanged.

Checks

  • No UI change.
  • iOS only, because the race is in an iOS test. Android was not run.
  • Before the fix: the test failed 2 of 150 iterations under CPU load.
  • Forced race (running status withheld by a temporary local change): the original assertion failed 10 of 10, the new wait passed 10 of 10.
  • After the fix: the test passed 300 of 300 iterations under CPU load.
  • SessionChatViewModelTests x25: 22 passed, 3 failed. All 3 failures are catchUpChrome_showsSyncingPill, a separate flake this pull request does not change. The same test failed 1 of 25 baseline runs without this change.
  • Full iOS unit suite: passed 3 of 3 runs, 2 of them under CPU load.

Issue

No tracked issue. Found through intermittent ios-checks failures.

Risks / Follow-ups

  • catchUpChrome_showsSyncingPill is still flaky and can still fail ios-checks.
  • testUserMessageOf190000Lines_hasASmallRow ended the test process once in CI. The cause is unknown: no crash report or result bundle was retained. It did not reproduce in 90 focused runs or 3 full-suite runs, and this pull request does not address it.
  • sendPrompt_postSendReloadMatchingUser_dropsOptimistic is unchanged. It passed 150 of 150 iterations under CPU load. A reload superseded by a newer timeline apply calls its completion before the newer apply publishes, which could explain its one failure, but that link is unconfirmed.

Show it working
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

The running status reaches the screen on its own stream after send progress clears, so the settle hold can still show the last Sending label when sendPrompt returns.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Automated review: no finding that 2+ of 3 passes agreed on.

opencode pr-review · passes: muse-spark-1.3-contributor, glm-5.3-flash, deepseek-v4.1-flash · $0.024

@ivanfenenko
ivanfenenko added this pull request to the merge queue Nov 23, 2026
Merged via the queue into main with commit 0255b36 Nov 23, 2026
@ivanfenenko
ivanfenenko deleted the fix/ios-flaky-session-tests branch November 23, 2026 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant