fix(photos): unflake Log fifth-photo cap widget test - #23
Merged
Conversation
The fifth-photo cap test used a fixed 300ms runAsync delay. On a loaded CI runner, JPEG+IO can outlive that window, CAMERA stays disabled via _attachingPhoto, and the next tap no-ops — so the counter never reaches 5 / 5. That flake failed verify-full on CES-41 (PR #21) and on the CES-40 merge; it is not an export regression. Poll+pump until the thumbnail strip and source buttons settle, and stall the cap test's picker past 300ms so the race fails closed. Co-authored-by: JMNofziger <JMNofziger@users.noreply.github.com>
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.
TL;DR
verify-fullfailed onclient/test/app/log_page_photos_test.dart—the fifth photo disables both sources(find.text("5 / 5")found 0).client-testfailure already happened on the CES-40 photos merge tomain. Production photo UI is unchanged.Cause
_tapWithIowaited a fixed 300ms of real time insiderunAsyncafter tapping CAMERA._attachPhotosets_attachingPhoto = true, which disables CAMERA/LIBRARY. If JPEG decode + sandbox IO outlives that window (loaded GHA runner,flutter testisolates in parallel):5 / 5.Reproduced locally by stalling the fake picker at 400ms: only every other tap attached, final counter was
2 / 5, same assertion as CI.Fix
_tapWithIonow pumps insiderunAsyncuntil the thumbnail strip and source buttons settle (and until CAMERA is tappable again, or at cap / denied).Test plan
flutter test --no-pub test/app/log_page_photos_test.dart --name "the fifth photo"with 400ms stalllog_page_photos_test.dart(6 tests)flutter analyze --no-pub— no issuesflutter test --no-pub— 276 passed, 1 skipped (E2E)