Skip to content

test: wait for UI and repository work on slow CI emulators - #6

Merged
thisislvca merged 1 commit into
refactor/rename-to-albafrom
test/stabilize-device-tests
Oct 17, 2026
Merged

thisislvca merged 1 commit into
refactor/rename-to-albafrom
test/stabilize-device-tests

Conversation

@thisislvca

Copy link
Copy Markdown
Owner

Stacked on #5. Device tests fail intermittently on CI, with a different test failing each run. This makes them wait properly on CI's slow emulators.

Cause

CI runs on two-core Pixel 2 emulators with software rendering. Two patterns time out there:

  • Fixed 10-second waits on repository work. Shared-invitation loading, trash and other edits go through DefaultGalleryRepository.edit, which waits for any catalog refresh in progress. CI timings for the failing tests were about 14 s, which fits a 10 s timeout plus setup. Failing tests: DemoReviewGapsTest.invitationAccept… and GalleryCompletionTest.cloudTrash….
  • Assertions right after something asynchronous, such as a tab switch, recreate(), the viewer's shared-element transition, or an AlertDialog window opening. Failing tests: GalleryNavigationTest.libraryLeads… (also fails on main), AlbaAppTest.androidBackClears… and IncomingMediaActivityTest.sharedPhotoCanBeImported….

Change

  • CI_WAIT_MS = 30s, replacing every 10-second waitUntil in the app device tests (19 call sites).
  • A waitUntilDisplayed(matcher) helper, used at the bare assertions listed above.

No production code changes. Disabling animations was considered and rejected, because some tests check intermediate animation frames.

Verification

  • None of these failures reproduced locally on hardware-GPU emulators, including under synthetic CPU load. The causes come from reading the code and the CI timings.
  • All 11 changed test classes pass on an Android 37 emulator (42 tests).
  • CI on this PR is the real check.

CI runs device tests on two-core emulators with software rendering, so
several tests failed intermittently, a different one each run:

- Raise 10-second waits to a shared 30-second CI_WAIT_MS. Repository
  edits queue behind catalog refreshes and could exceed 10 seconds.
- Replace assertions made right after navigation, activity recreation,
  the viewer transition or a dialog opening with waitUntilDisplayed.
@thisislvca
thisislvca merged commit 0575250 into refactor/rename-to-alba Oct 17, 2026
1 of 3 checks passed
@thisislvca
thisislvca deleted the test/stabilize-device-tests branch October 17, 2026 15:29
thisislvca added a commit that referenced this pull request Oct 17, 2026
CI runs device tests on two-core emulators with software rendering, so
several tests failed intermittently, a different one each run:

- Raise 10-second waits to a shared 30-second CI_WAIT_MS. Repository
  edits queue behind catalog refreshes and could exceed 10 seconds.
- Replace assertions made right after navigation, activity recreation,
  the viewer transition or a dialog opening with waitUntilDisplayed.
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