Skip to content

fix(test): wait for track-name update in assertPlayer#321

Merged
formatBCE merged 1 commit intodevfrom
fix/playertest-flake
May 2, 2026
Merged

fix(test): wait for track-name update in assertPlayer#321
formatBCE merged 1 commit intodevfrom
fix/playertest-flake

Conversation

@teancom
Copy link
Copy Markdown
Contributor

@teancom teancom commented May 2, 2026

A couple tests added in #314 would only intermittently pass (almost always locally, very flaky in CI). This should fix that, if my robot sidekick is right (it worked well locally, but so did the first version).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@teancom teancom added the bug Something isn't working label May 2, 2026
@teancom teancom requested a review from seadowg May 2, 2026 04:26
@teancom teancom mentioned this pull request May 2, 2026
@formatBCE formatBCE merged commit 5b01964 into dev May 2, 2026
2 checks passed
@formatBCE formatBCE deleted the fix/playertest-flake branch May 2, 2026 04:36
@seadowg
Copy link
Copy Markdown
Collaborator

seadowg commented May 2, 2026

@teancom looks good! We'll most likely want to prefer "wait" assertions over immediate ones as ComposeTestRule is only synchronized with the UI thread (details here if you're interested) and the app has a lot of event reaction logic that uses Flow either gets executed on a background thread or scheduled on the UI thread (giving the tests a window to assert before things have actually completed).

A nice trick if you spot a flake like this is to stick a Thread.sleep(1000) in before the flaky assertion, see if it passes every time, and if so then replace with a waitUntil or one of the async assertions like waitUntilAtLeastOneExists.

@seadowg seadowg removed their request for review May 2, 2026 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants