trajectory
py-flaky-test-01core-12pythonDifficulty tier 3/5

Fix a test that fails one run in four without deleting it

flakinessdeterminismtestingrandomness

Task parameters

Reference steps
11
Step ceiling
40
Runs
25
Solved
20 of 25
Agents
10

What is broken, and what fixed means

A sampling library for a request auditor draws from the global `random` stream, so the behaviour a test observes depends on whatever entropy the process started with. One test asserts that a sample of 8 requests out of 40 covers all four tenants, which is true about seven runs in ten, so the suite fails roughly one run in four and passes on rerun. Fixing it means making the randomness injectable and pinning the draw in the test, not seeding a global inside the library, not loosening the assertion, and not marking the test away. Production sampling has to stay random, and the hidden tests check that it still is.

How strong the hidden tests are

Mutation testing: the reference replayed with one small change in a file it writes, the slip a model makes, and the hidden tests run on the result. A change the tests pass is a near miss this reward would pay in full.

Near misses caught
7 of 12
By an assertion
7
Got through
5
Mutation sites
18

Changes the hidden tests did not reliably notice

  • src/sampler/core.py:44 not x -> x
  • src/sampler/core.py:46 == -> !=
  • src/sampler/core.py:134 <= -> <
  • src/sampler/core.py:134 < -> <=
  • src/sampler/core.py:142 6 -> 7

Some of these may be equivalent to the original, so no test could notice them. The rest are near misses this reward would pay in full.

Results by agent

One group per agent, a scripted policy that checks the harness or a real model. The solve rate carries its spread across seeds, and every run below it links to the full step by step replay.

nvidia_nim/minimaxai/minimax-m3.1-flash

100.0%+/- 0.0% over 2 seeds

2 runs, seeds 0, 1

nvidia_nim/nvidia/nemotron-3-ultra-550b-a55b

100.0%+/- 0.0% over 2 seeds

2 runs, seeds 0, 1

nvidia_nim/nvidia/nemotron-3.5-lightning-30b-a3b

100.0%+/- 0.0% over 2 seeds

2 runs, seeds 0, 1

nvidia_nim/openai/gpt-oss-20b

100.0%+/- 0.0% over 2 seeds

2 runs, seeds 0, 1

nvidia_nim/z-ai/glm-5.3

0.0%+/- 0.0% over 2 seeds

2 runs, seeds 0, 1

stub:hasty

0.0%+/- 0.0% over 3 seeds

3 runs, seeds 0, 1, 2

stub:methodical

100.0%+/- 0.0% over 3 seeds

3 runs, seeds 0, 1, 2

stub:reckless

100.0%+/- 0.0% over 3 seeds

3 runs, seeds 0, 1, 2

stub:sloppy

100.0%+/- 0.0% over 3 seeds

3 runs, seeds 0, 1, 2

stub:thrasher

100.0%+/- 0.0% over 3 seeds

3 runs, seeds 0, 1, 2