Skip to content

fix(tests): Use unique email in flaky custom auth integration test#7113

Open
matthewelwell wants to merge 1 commit intomainfrom
fix/flaky-custom-auth-test
Open

fix(tests): Use unique email in flaky custom auth integration test#7113
matthewelwell wants to merge 1 commit intomainfrom
fix/flaky-custom-auth-test

Conversation

@matthewelwell
Copy link
Copy Markdown
Contributor

Thanks for submitting a PR! Please check the boxes below:

  • I have read the Contributing Guide.
  • I have added information to docs/ if required so people know about the feature.
  • I have filled in the "Changes" section below.
  • I have filled in the "How did you test this code" section below.

Changes

test_register__with_sign_up_type__stores_sign_up_type used the hardcoded email test@example.com, which appears in 15+ other tests in the same file. Under certain xdist worker orderings, another test's test@example.com user was visible through the same DB session when the UniqueValidator ran, causing a 400 "Email already exists" response instead of the expected 201 (as seen in https://github.com/Flagsmith/flagsmith/actions/runs/23909436003/job/69727179889).

  • Replace the hardcoded email with f"test-{uuid.uuid4()}@example.com"
  • Remove the unused settings fixture parameter

How did you test this code?

The flaky failure was observed in CI. The fix removes the shared email that was causing non-deterministic collisions under parallel xdist execution.

The test was using a hardcoded `test@example.com` that appears in 15+
other tests in the same file. Under certain xdist worker orderings this
caused a 400 "Email already exists" validation error instead of the
expected 201, making the test flaky.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@matthewelwell matthewelwell requested a review from a team as a code owner April 2, 2026 17:16
@matthewelwell matthewelwell requested review from khvn26 and removed request for a team April 2, 2026 17:16
Copy link
Copy Markdown

@claude claude bot left a comment

Choose a reason for hiding this comment

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

⚠️ Code review skipped — your organization's overage spend limit has been reached.

Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit at claude.ai/admin-settings/claude-code.

Once credits are available, reopen this pull request to trigger a review.

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

3 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs Ignored Ignored Preview Apr 2, 2026 5:16pm
flagsmith-frontend-preview Ignored Ignored Apr 2, 2026 5:16pm
flagsmith-frontend-staging Ignored Ignored Apr 2, 2026 5:16pm

Request Review

@github-actions github-actions bot added api Issue related to the REST API fix labels Apr 2, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-e2e:pr-7113 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-api-test:pr-7113 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-frontend:pr-7113 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-7113 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-api:pr-7113 Finished ✅ Results
ghcr.io/flagsmith/flagsmith:pr-7113 Finished ✅ Results

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.33%. Comparing base (d8edc2a) to head (b70151a).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7113   +/-   ##
=======================================
  Coverage   98.33%   98.33%           
=======================================
  Files        1335     1335           
  Lines       49939    49939           
=======================================
  Hits        49109    49109           
  Misses        830      830           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  45.7 seconds
commit  b70151a
info  🔄 Run: #15670 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  47.8 seconds
commit  b70151a
info  🔄 Run: #15670 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  44.4 seconds
commit  b70151a
info  🔄 Run: #15670 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  54 seconds
commit  b70151a
info  🔄 Run: #15670 (attempt 1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api Issue related to the REST API fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant