Skip to content

fix(photos): unflake Log fifth-photo cap widget test - #23

Merged
JMNofziger merged 1 commit into
mainfrom
cursor/ces-41-photo-cap-test-405d
Aug 21, 2026
Merged

fix(photos): unflake Log fifth-photo cap widget test#23
JMNofziger merged 1 commit into
mainfrom
cursor/ces-41-photo-cap-test-405d

Conversation

@JMNofziger

@JMNofziger JMNofziger commented Aug 16, 2026

Copy link
Copy Markdown
Owner

TL;DR

  • CES-41 PR CES-41 — Export ZIP #21 verify-full failed on client/test/app/log_page_photos_test.dartthe fifth photo disables both sources (find.text("5 / 5") found 0).
  • Not an export regression. Same client-test failure already happened on the CES-40 photos merge to main. Production photo UI is unchanged.

Cause

_tapWithIo waited a fixed 300ms of real time inside runAsync after tapping CAMERA. _attachPhoto sets _attachingPhoto = true, which disables CAMERA/LIBRARY. If JPEG decode + sandbox IO outlives that window (loaded GHA runner, flutter test isolates in parallel):

  1. The next CAMERA tap hits a disabled button / early-returns.
  2. Fewer than 5 photos land.
  3. The counter never reads 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

  • _tapWithIo now pumps inside runAsync until the thumbnail strip and source buttons settle (and until CAMERA is tappable again, or at cap / denied).
  • The cap test’s picker stalls 400ms so a 300ms fixed wait cannot silently pass again.

Test plan

  • flutter test --no-pub test/app/log_page_photos_test.dart --name "the fifth photo" with 400ms stall
  • Full log_page_photos_test.dart (6 tests)
  • flutter analyze --no-pub — no issues
  • Full flutter test --no-pub — 276 passed, 1 skipped (E2E)
Open in Web Open in Cursor 

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>
@JMNofziger
JMNofziger marked this pull request as ready for review August 21, 2026 10:55
@JMNofziger
JMNofziger merged commit 7e7ae1b into main Aug 21, 2026
5 checks passed
@JMNofziger
JMNofziger deleted the cursor/ces-41-photo-cap-test-405d branch August 21, 2026 11:06
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.

2 participants