Skip to content

test(secrets): isolate unowned recovery backend probes - #1259

Merged
skevetter merged 1 commit into
mainfrom
test/secrets-isolate-unowned-recovery
Sep 21, 2026
Merged

skevetter merged 1 commit into
mainfrom
test/secrets-isolate-unowned-recovery

Conversation

@skevetter

Copy link
Copy Markdown
Contributor

Root cause

TestStore_UnownedWithoutBackendStateIsRecoverable used newSystemBackendRegistry, so the unit test's first Get probed the runner's real macOS login keychain for the fixed default/LEGACY key. Under the GoReleaser -race package run, that key could exist in the shared keychain from another test invocation or runner state. The registry then repaired the legacy entry to BackendKeyring, and Get returned the stored value instead of the expected actionable unowned error. Attempts 1 and 2 of Actions run 35633642155 both failed with expected actionable unowned error, got <nil> (0.68s and 1.16s), confirming an external-state dependency rather than a timing assertion.

Fix

Use the existing in-memory keyring and file backend fakes for this recovery behavior test. Both are deliberately empty for the initial Get, and the same registry then verifies that Set and Get recover the entry without touching a platform keychain.

No retry or sleep is added. Product code and the system-backend probe coverage remain unchanged.

Validation

  • go test ./pkg/secrets -run '^TestStore_UnownedWithoutBackendStateIsRecoverable$' -count=20
  • go test -race ./pkg/secrets -run '^TestStore_UnownedWithoutBackendStateIsRecoverable$' -count=10
  • go test ./pkg/secrets
  • git diff --check

Signed-off-by: Samuel K <skevetter@pm.me>
@netlify

netlify Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for devsydev canceled.

Name Link
🔨 Latest commit f123f31
🔍 Latest deploy log https://app.netlify.com/projects/devsydev/deploys/6ab1861b1f03c80008752af0

@coderabbitai

coderabbitai Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 11 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 5bb5ad7b-3fbc-434c-833f-7b75ecb75e8e

📥 Commits

Reviewing files that changed from the base of the PR and between bfbaba7 and f123f31.

📒 Files selected for processing (1)
  • pkg/secrets/store_internal_test.go

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@netlify

netlify Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for images-devsy-sh canceled.

Name Link
🔨 Latest commit f123f31
🔍 Latest deploy log https://app.netlify.com/projects/images-devsy-sh/deploys/6ab1861b2f5df20008fad2ca

@skevetter
skevetter marked this pull request as ready for review September 21, 2026 20:43
@mergify

mergify Bot commented Sep 21, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@skevetter
skevetter merged commit f8f50c3 into main Sep 21, 2026
150 of 152 checks passed
@skevetter
skevetter deleted the test/secrets-isolate-unowned-recovery branch September 21, 2026 20:54
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