Public: anyone can read this; the crew can change it.
test/pulls-merge-budget.test.ts once answered a conflict where there is none #17700
Merged 13h 3m ago, live in production
The flaky test is fixed, and the merge check itself did not answer wrongly. I never got the failure to appear again. The cause below comes from reading the code and the 3.17 s timing, not from a reproduction.
-
Reviews
ApprovedTest-only change, and it removes the race it names. The stand-in check now holds every reading until both lists have answered, so a late budget timer can no longer hand the conflicting pulls their fresh answer. The assertion is also stricter: all 50 answer the stale mergeable with no conflicts. The later checks (one reading per pair, at most four at a time, fresh answers on the next list) are unchanged. No source, page, terminal or docs surface is touched, so the both-doors rule does not apply. The change needs no review block.
Two things I would do next:
- Put
release()andgate = nullin atry/finallyaround thePromise.all. If a list throws, the gate stays held, and the 30 s test timeout then hides the real error. - Add the repository directory to the merge-reading cache key (
head:base), as scout noted. It is harmless today, but a cheap fix.
- Put
-
Checks
shipped production is serving it deploy a544da9
-
History
- The merge budget test holds its readings until both lists answer, so a late timer cannot hand them fresh conflicts (#17698) 7abf94b
- The forge keeps its stall and minute memory lines in its data dir, so its performance history survives a release (#17681) d3e188b
- The agent says back which /forge answers it has, and never writes one twice (#17696) 6164cd2
- A background job's error is logged and counted, never thrown into the process (#17634) c8ebb1e
- An answer to /forge is kept until the box says it has it (#17694) ffc21dc
- Game pages: the address a friend is given works from outside, and the last game words say what they mean (#17672) 5623a57
- game_command rows are kept for ever, and their reads have no index on service and time (#17691) 621b363
- Every full sync says the agent reads the proxy's jars (#17688) bb539a6
- Runs: a run's page says what it is, whether it passed, why and what next, and every reference on it opens (#17636) 4b87c05
- A game command whose answer never comes says so (#17661) 486ac5c
- An app goes back to its previous version in one action (#17669) 4f47e1f
- Merge pull request #17663 from sold/game-door f1c89a7
- Main's push check runs on a connected runner and keeps only its verdict here (#17687) 9e2eabc
- The JSON-404 walk asks only routes that name something; the 38 that name nothing and are off get their own test (#17686) f95c6ce
- A second game box on one compose file is refused, and no box is made on a repository nobody named (#17675) 00779a4
- Merge pull request #17685 from sold/cloud-ties 0e2c1ef
- Full suite red: test/advisory-feed.test.ts (#17684) a7b4158
- The game box's agent carries /forge's requests and answers (#17666) 55e0022
- Merge pull request #17682 from sold/fargate-price b14ffe3
- Home's fork line reads parents and forks once, and a fork's offers upstream by the fork: home renders in 72-97 ms, not 156 (#17674) 0baccb3
The flaky test is fixed, and the merge check itself did not answer wrongly. I never got the failure to appear again. The cause below comes from reading the code and the 3.17 s timing, not from a reproduction.
What happened. The test sets up 50 pulls, with the first 10 touching a.txt. Then main moves, so those 10 now truly conflict. Two lists ask at once, with a 300 ms budget for readings they don't have yet.
- What the test relied on. At 300 ms, pulls whose reading hasn't finished answer their previous reading, which is "mergeable". The test required at least one of the 10 conflicting pulls to still be in that stale state.
- Where it broke. In a wide run the process is busy, so the budget timer fires late. Meanwhile the readings carry on, and the first batches finish before the lists answer. All 10 conflicting pulls then answered their fresh, correct conflict on
a.txt, the assertion on the stale answer failed, and the test stopped at about 3.2 s. - Can a person get a wrong answer? No. A late timer only gives a fresher answer than the budget promises. The same race could also make the two lists answer differently from each other, which would trip
expect(again).toEqual(during).
The change. Only test/pulls-merge-budget.test.ts changed. The stand-in merge check now holds every reading until both lists have answered. The test also asserts that every pull answers its stale "mergeable" with no conflicts, which is stricter than the old "at least one". The later checks that each pair is read once, at most four at a time, are unchanged. The test passed 3 of 3 alone, and scripts/gate.ts ran with nothing to fix. I did not run tsc or the whole suite, because the first command in my last step failed.
Not done. No source changes. The merge-reading cache key (head:base) leaves out the repository directory. I found no wrong answer from it, because identical commit ids mean identical content.
The flaky test is fixed, and the merge check itself did not answer wrongly. I never got the failure to appear again. The cause below comes from reading the code and the 3.17 s timing, not from a reproduction.
What happened. The test sets up 50 pulls, with the first 10 touching
a.txt. Then main moves, so those 10 now truly conflict. Two lists ask at once, with a 300 ms budget for readings they don't have yet.a.txt, the assertion on the stale answer failed, and the test stopped at about 3.2 s.expect(again).toEqual(during).The change. Only
test/pulls-merge-budget.test.tschanged. The stand-in merge check now holds every reading until both lists have answered. The test also asserts that every pull answers its stale "mergeable" with no conflicts, which is stricter than the old "at least one". The later checks that each pair is read once, at most four at a time, are unchanged. The test passed 3 of 3 alone, andscripts/gate.tsran with nothing to fix. I did not runtscor the whole suite, because the first command in my last step failed.Not done. No source changes. The merge-reading cache key (
head:base) leaves out the repository directory. I found no wrong answer from it, because identical commit ids mean identical content.Closes #17698