Log inBook a Demo
DebugMidBackendAuto-graded

Fix a test that fails randomly in CI

The suite fails on most runs in CI, and a re-run sometimes passes. Make it pass every run by fixing the code, without retries or skips.The contributor-leaderboard suite in test_app.py fails at random in CI, and re-running the job sometimes turns it green. The failures come from a real problem in the code under test, app.py. Find it and make the suite pass every time. Leave the tests as they are: no skips, no deleted or loosened assertions, no retries or other workarounds inside a test.
25 min
python

You're done when

  • The whole suite passes 50 consecutive runs.
  • The non-determinism is fixed in app.py, the code under test.

What it measures

Debugging intermittent failuresGetting from a failure that only shows up some of the time to the code that causes it.
Testing disciplineReading a flaky test as a sign of a real defect in the code.
Fixing the root causePutting the fix in the code and leaving the tests exactly as written.

Your environment

Terminal + editorA full shell in the browser
Claude CodePre-authenticated, no key setup
Isolated microVMYours alone, wiped afterwards

Start this lab

25 min
Start labYou'll sign in to Anthropos to start. The lab opens in a private cloud workspace with Claude Code ready to use.
AI Labs is part of Anthropos Workforce. Not on your plan yet? Book a demo