Skip to content

Conversation

@marcoacierno
Copy link
Member

Summary

Fixed the flaky test_submissions_are_random_by_user test by increasing the number of submissions and improving the test logic.

Changes

  • Increased submissions from 3 to 10 (10! = ~3.6M possible orderings)
  • Reduced from 3 users to 2 users (only need to verify difference)
  • Added consistency test: same user gets same ordering on repeated queries
  • Improved documentation explaining the test logic

Fixes #4526

🤖 Generated with Claude Code

The test was flaky because with only 3 submissions there are only 6
possible orderings (3!), giving a ~33% chance that two users would get
the same random ordering.

Changes:
- Increased submissions from 3 to 10 (10! = ~3.6M possible orderings)
- Reduced from 3 users to 2 users (only need to verify difference)
- Added consistency test: same user gets same ordering on repeated queries
- Improved documentation explaining the test logic

Fixes #4526

Co-authored-by: Marco Acierno <marcoacierno@users.noreply.github.com>
@vercel
Copy link

vercel bot commented Jan 10, 2026

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

Project Deployment Review Updated (UTC)
pycon Building Building Preview Jan 10, 2026 7:13am

@marcoacierno marcoacierno merged commit d69e0a2 into main Jan 10, 2026
7 checks passed
@marcoacierno marcoacierno deleted the claude/issue-4526-20260110-0708 branch January 10, 2026 07:18
@codecov
Copy link

codecov bot commented Jan 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.42%. Comparing base (4cb76dd) to head (9125cac).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4527   +/-   ##
=======================================
  Coverage   94.42%   94.42%           
=======================================
  Files         352      352           
  Lines       10141    10141           
  Branches      732      732           
=======================================
  Hits         9576     9576           
  Misses        468      468           
  Partials       97       97           
🚀 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.

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.

Fix flaky test test_submissions_are_random_by_user

2 participants