Skip to content

TW-5665: disable system keyring in TestValidateDefaultGrant (fix release test hang)#113

Merged
qasim-nylas merged 1 commit into
mainfrom
feature/TW-5665-fix-keyring-test-hang
Jun 22, 2026
Merged

TW-5665: disable system keyring in TestValidateDefaultGrant (fix release test hang)#113
qasim-nylas merged 1 commit into
mainfrom
feature/TW-5665-fix-keyring-test-hang

Conversation

@qasim-nylas

Copy link
Copy Markdown
Collaborator

Summary

The v3.1.26 release failed at the Run tests step: the job hit the 10-minute timeout and panicked, so the tag/GoReleaser steps never ran and the release did not ship.

Root cause

TestValidateDefaultGrant/removed_default_returns_a_clear,_actionable_error reached the real macOS keychain:

validateDefaultGrant (client.go:317)
  -> NewDefaultGrantStore (grantstore.go:31)
  -> migrateLegacyGrantStore (grantstore.go:46)
  -> keyring.NewSecretStore (keyring.go:73)
  -> SystemKeyring.IsAvailable (keyring.go:50)   // keyring.Set spawns macOS `security`
  -> os/exec Wait -> wait4   [blocked 9 minutes]

The test isolated HOME but not the keyring. On the CI macOS runner the keychain is locked, so the security subprocess blocked until the test timeout. It passes locally because the dev keychain is unlocked.

Fix

Set t.Setenv("NYLAS_DISABLE_KEYRING", "true") in TestValidateDefaultGrant so it uses the encrypted-file fallback instead of the real keychain — matching the convention already used in grantstore_test.go and remote_resources_test.go.

Verification

  • TestValidateDefaultGrant was the only test hitting the real keychain under go test ./... -short (the air integration test is gated by //go:build integration; TestProvidersCmd skips on testing.Short() before its keyring call).
  • Passes after the fix: go test ./internal/cli/common/ -run TestValidateDefaultGrant.

Follow-up

Re-run the v3.1.26 release after merge. Nothing was partially released.

Related docs

Jira: TW-5665

The test reached the real macOS keychain via NewDefaultGrantStore ->
SystemKeyring.IsAvailable, which spawns the 'security' binary. On the
release CI runner the keychain is locked, so the subprocess blocked until
the 10-minute test timeout, failing the v3.1.26 release.

Set NYLAS_DISABLE_KEYRING=true so the test uses the encrypted-file
fallback, matching the convention in grantstore_test.go and
remote_resources_test.go.
@qasim-nylas qasim-nylas requested a review from AaronDDM June 22, 2026 15:33

@AaronDDM AaronDDM left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@qasim-nylas qasim-nylas merged commit 160b0c3 into main Jun 22, 2026
7 checks passed
@qasim-nylas qasim-nylas deleted the feature/TW-5665-fix-keyring-test-hang branch June 22, 2026 15:41
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.

2 participants