Skip to content

test: raise Keychain retry budget to stop the macos-15 selection flake - #94

Merged
StuartMeeks merged 1 commit into
mainfrom
test/keychain-retry-budget-macos15-flake
Sep 21, 2026
Merged

StuartMeeks merged 1 commit into
mainfrom
test/keychain-retry-budget-macos15-flake

Conversation

@StuartMeeks

Copy link
Copy Markdown
Owner

Problem

KeychainCredentialManagerTests.RestoreCredentialAsync_PreservesAccountIdAndSelection flakes on the macos-15 CI leg (Assert.True() Failure — Expected: True, Actual: False) — seen red on #89 and #92, green on re-run and on macos-14. It's a cross-process Keychain visibility timing flake, not a product defect.

RetryHelper's default budget was 20 × 25 ms ≈ 500 ms. After RestoreCredentialAsync, the selection is a separate store item written moments earlier; on a contended macos-15 runner it wasn't always visible within 500 ms, so UntilAsync returned its last result with IsSelected == false and the following assertion failed.

Fix

Raise the default budget to 40 × 50 ms ≈ 2 s. Retries return as soon as the store is consistent, so passing runs don't pay the ceiling; only a genuine failure now waits ~2 s before surfacing. RetryHelperTests pass explicit values and are unaffected.

Test-only change; documented in RetryHelper's remarks and CHANGELOG.md.

🤖 Generated with Claude Code

RetryHelper defaulted to 20 attempts x 25 ms ~= 500 ms. On a contended macos-15
runner that was too tight for cross-process Keychain visibility: the selection
item written by RestoreCredentialAsync was not always visible within it, so
RestoreCredentialAsync_PreservesAccountIdAndSelection timed out its IsSelected
retry and the following Assert.True(restored.IsSelected) failed intermittently
(seen red on #89 and #92, green on re-run and elsewhere).

Raise the default budget to 40 x 50 ms ~= 2 s. Retries return as soon as the
store is consistent, so a passing run does not pay the ceiling; only a genuine
failure now waits the full ~2 s before surfacing. RetryHelperTests pass explicit
values and are unaffected. Test-only change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@StuartMeeks
StuartMeeks merged commit a94cacb into main Sep 21, 2026
11 checks passed
@StuartMeeks
StuartMeeks deleted the test/keychain-retry-budget-macos15-flake branch September 21, 2026 06:43
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