Repository navigation
test: fix DemoReviewGapsTest invitation flake on Android 36 - #8
Closed
thisislvca wants to merge 3 commits into
Closed
thisislvca wants to merge 3 commits into
thisislvca wants to merge 3 commits into
Conversation
Sheets assign Compose state right after the view-model call returns. With the IO hop resuming on the IO thread under the Compose test dispatcher, the writes raced the recomposer and the sheet stayed on its first frame (spinner, no content), which made DemoReviewGapsTest time out intermittently.
thisislvca
force-pushed
the
test/fix-demo-invitations-api36
branch
from
October 17, 2026 20:04
835addc to
82fbb22
Compare
Owner
Author
|
Closing in favor of a test-side fix. The diagnosis here is right: the invitation result was applied off the main thread, so the sheet never updated. But that only happens because DemoReviewGapsTest uses the deprecated v1 Compose test rule, whose UnconfinedTestDispatcher resumes coroutines inline on the IO thread. In the app, LaunchedEffect resumes on the main thread. Instead of changing AlbaViewModel, the tests will move to the v2 rules (androidx.compose.ui.test.junit4.v2), which should also fix the other 'UI never updates' flakes. |
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.
Fixes the intermittent API 36 failure of DemoReviewGapsTest.invitationAcceptAndRequestApprovalWorkThroughTheirSheets.
On failure the semantics dump showed the sheet frozen on its first frame (progress bar, no invitations or participants) while the repository had already returned the data. The sheet load resumed on the IO thread, so Compose state was written off the main thread and the update was lost. Shared-sheet view-model calls now hand results back on the main thread. FailureCapture also logs every compose root to logcat, since managed-device additional output was not being collected.