fix(integration-tests): isolate user data per test run#41
Merged
Conversation
## Summary - Generate a unique custom-auth subject per test instance instead of reusing a static `JWT_AUTH_SUBJECT` (default `java-sdk-sub-id`) - Add `jwt_auth_user` helper that lazily creates a fresh Privy user via `users.create` with a `custom_auth` linked account - `generate_test_jwt` now ensures the user exists before signing, since downstream endpoints (e.g. `/wallets/authenticate`) reject JWTs for unknown subjects - JWT exchange tests provision a wallet for the user upfront — `/wallets/authenticate` requires the user to own a wallet; the old shared user worked only because it had wallets accumulated from past runs ## Why Each integration run added wallets under the same shared user, eventually tripping the per-user wallet limit (e.g. `User has reached a maximum limit of 100 tron wallets`). A fresh user per test means every run starts clean. ## Test plan - [x] `bundle exec rake test:integration` passes twice in succession (verifies fresh data per run) - [x] `bundle exec rake test` passes - [x] `bundle exec rake lint` passes
jagtejsodhi
approved these changes
May 14, 2026
Open
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
JWT_AUTH_SUBJECT(defaultjava-sdk-sub-id)jwt_auth_userhelper that lazily creates a fresh Privy user viausers.createwith acustom_authlinked accountgenerate_test_jwtnow ensures the user exists before signing, since downstream endpoints (e.g./wallets/authenticate) reject JWTs for unknown subjects/wallets/authenticaterequires the user to own a wallet; the old shared user worked only because it had wallets accumulated from past runsWhy
Each integration run added wallets under the same shared user, eventually tripping the per-user wallet limit (e.g.
User has reached a maximum limit of 100 tron wallets). A fresh user per test means every run starts clean.Test plan
bundle exec rake test:integrationpasses twice in succession (verifies fresh data per run)bundle exec rake testpassesbundle exec rake lintpasses