test: retry on the asserted property, not just the count - #72
Merged
Conversation
RestoreCredentialAsync_Preserves... waited via RetryHelper.UntilAsync with a `r.Count == 1` predicate and then asserted restored.IsSelected. IsSelected is read from a separate store item -- the selection record -- written moments earlier by RestoreCredentialAsync, so the credential item can become visible before the selection item does. The count-only predicate let the assertions run against a half-visible store. Observed on the macOS runner during PR #60's CI, where the identical commit then passed on main, confirming timing rather than regression. The predicate now covers what is actually asserted, on both native backends. Co-Authored-By: Claude Opus 5 <noreply@anthropic.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.
Fixes #61.
Why it flaked
IsSelectedis read from a separate store item — the selection record — written moments earlier byRestoreCredentialAsync. The credential item can become visible before the selection item does, so a count-only predicate lets the assertions run against a half-visible store.Observed on the macOS leg of PR #60's CI; the identical commit then passed on
main, which is what confirmed timing rather than regression.Fix
The predicate now covers the property being asserted:
Applied to both native backends — libsecret has the same shape and the same exposure, it just hasn't been unlucky yet.
Verification
Build clean, 408 tests (354 passed, 54 skipped) — unchanged; this is a timing fix, not new coverage.
A flake fix can't be proven by a green run, so I'm not claiming it is. What's verifiable is the mechanism: the wait now covers every value the test asserts, so there is no window where the assertions can observe a partially-visible store.
🤖 Generated with Claude Code