Skip to content

test(ios): keep status notes on screen for the paste-control UI test - #151

Merged
johnny4young merged 1 commit into
mainfrom
fix/ios-paste-control-hosted
Sep 17, 2026
Merged

johnny4young merged 1 commit into
mainfrom
fix/ios-paste-control-hosted

Conversation

@johnny4young

Copy link
Copy Markdown
Owner

Root cause

CaptureFlowUITests.testPasteControlTapSavesPasteboardContent failed on the hosted iOS runner (run 35135515537 twice on feat/ocr-entity-chips, and a control dispatch of main) while passing locally. The evidence in the run's xcresult shows the paste itself succeeded: the accessibility hierarchy captured at the failure already held the clip-row for "gancho paste-drive sample" (17 s old) and the durable "Saved" chip, and the screen recording shows the row at 0 s two seconds after the tap. What the test never observed was the save-note chip, which flashNote dismisses after 2 s: with -enableCodeCoverage YES the hosted runner takes longer than that between two accessibility snapshots (the test took 26 s there vs 7.5 s locally), so waitForExistence(timeout: 8) only sampled after the note was gone.

Fix

  • DEBUG launch argument -ui-test-keep-save-notes: flashNote skips only its two-second dismissal, so a real note stays until the next one replaces it. What is noted, and when, is unchanged.
  • The test launches with it, uses bounded 15 s waits (existence polling samples about once per second), and additionally asserts the durable outcome: the pasted text as a history row. Nothing it asserted before was dropped.

Verification

  • make lint: 0 violations. make test: 1,138 tests in 169 suites.
  • Local make test-ui-ios: 13 tests, 0 failures. The paste test self-skips when the simulator pasteboard already holds content synced from the Mac, so it was re-run on an erased iPhone 17 simulator and passed.
  • Hosted ui-tests.yml on this head, run 35143392167: iOS 13 tests, 0 failures, including the paste-control test; macOS UI green.

testPasteControlTapSavesPasteboardContent failed on the hosted runner
while the paste itself succeeded: the failure hierarchy already held the
history row for the sample text (17 s old) and the durable "Saved" chip,
and the recording shows the row at 0 s two seconds after the tap. What
the test never saw was the `save-note` chip, which flashes for two
seconds; with code coverage on, the hosted runner takes longer than that
between two accessibility snapshots, so `waitForExistence` missed a note
that did show. Locally the whole test runs in under eight seconds and
always caught it.

- New DEBUG launch argument `-ui-test-keep-save-notes`: `flashNote`
  skips only the two-second dismissal, so a real note stays until the
  next one replaces it. What is noted, and when, is unchanged.
- The test launches with it, waits generously (the runner is slow and
  existence polling samples about once per second), and now also asserts
  the durable outcome: the pasted text as a `clip-row`.

Verified locally on an erased iPhone 17 simulator; the test self-skips
when the simulator pasteboard already holds content synced from the Mac.
@johnny4young
johnny4young merged commit 9c53acb into main Sep 17, 2026
6 checks passed
@johnny4young
johnny4young deleted the fix/ios-paste-control-hosted branch September 17, 2026 00:05
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