Skip to content

test: let the app menu tests decide when a retry runs - #179

Merged
Seb-GRAF merged 1 commit into
mainfrom
test/app-menu-retries
Oct 22, 2026
Merged

Seb-GRAF merged 1 commit into
mainfrom
test/app-menu-retries

Conversation

@Seb-GRAF

Copy link
Copy Markdown
Collaborator

Problem

Since #174, the app menu recovery tests in NativePresentationTests fail on most CI runs, each time with one extra menu read: main's run for #176, and both runs of #177. A failed read is retried 250 ms later. The tests wait for that failed read, then change the fixture (clear the failure, revoke access, switch apps) and expect the retry to see the change. On a busy runner the test can take longer than 250 ms to resume, so the retry runs first, fails again, and a later retry adds the extra read.

Changes

  • AppMenu takes its retry wait as an init parameter, defaulting to Task.sleep, like it already takes checkAccess and readAttribute. The app's behavior is unchanged.
  • MenuReadFixture holds each retry (any non-zero wait) until the test calls allowRetry(), and stops waiting when the read task is cancelled. The five tests that change the fixture while a retry is pending call allowRetry() after their change, so a retry can no longer run before the test has changed the fixture, however slow the runner. menuRecoveryStopsAfterFourRetries keeps the real waits.

Testing

  • swift test --filter NativePresentationTests: passes three times in a row.
  • Simulated a slow runner by making the tests wait 600 ms after the failed read: on main, 4 tests fail with the same extra reads CI shows (7 issues); with this change they pass.

Merging

One commit, so a squash keeps the same message. It unblocks #177 and #178, and the beta that main's failed run skipped.

Claude Opus 5.5 via Claude Code (in T3 Code)

@Seb-GRAF
Seb-GRAF merged commit dc4a0a1 into main Oct 22, 2026
6 checks passed
@Seb-GRAF
Seb-GRAF deleted the test/app-menu-retries branch October 22, 2026 07:06
@stablebar-releases

Copy link
Copy Markdown

🎉 This PR is included in version 0.6.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant