chore(functional-tests): default test accounts to v2 key stretching#20556
Closed
chore(functional-tests): default test accounts to v2 key stretching#20556
Conversation
Because: * The vpn integration "authorization flow" test was flaky with a 401 on the second /oauth/authorization call. testAccountTracker creates v1 accounts, so the first sign-in triggers a v1→v2 upgrade (password/change/start + finish) that bumps account.verifierSetAt. The cached session still works for /account/profile and /session/status, but the assertion JWT used by /oauth/authorization fails validation and the OAuth code is never issued — so fxaOAuthLogin is never sent and the test times out. * v2 is the state real new accounts are created in nowadays, so the test setup should match. This commit: * Defaults BaseTarget's auth-client to keyStretchVersion=2 (overridable via AUTH_CLIENT_KEY_STRETCH_VERSION). Accounts created via testAccountTracker.signUp now register both v1 and v2 password hashes, so the in-app upgrade branch is skipped and the cached session remains valid across consecutive OAuth flows. closes FXA-13687 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Because: * The two authClientV2.spec.ts tests "it creates with v1 and signs in" and "it creates with v1 and upgrades to v2 on signin" were using target.authClient implicitly. With the previous commit defaulting the shared auth client to v2 key stretching, those tests would now create v2 accounts and their v1-only assertions would break. This commit: * Switches both tests to target.createAuthClient(1) explicitly. The peer test for v2 in the same file already uses target.createAuthClient(2), so this matches the existing pattern. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 tasks
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.
Summary
Pre-work that's independent of, but related to, #20543 (the actual VPN-integration race fix).
Test plan
🤖 Generated with Claude Code