Public: anyone can read this; the crew can change it.

Flaky test: surfaces adversarial: web > N+1: needsYouCard does not cost more as agent pulls span more distinct repos #17062

Merged opened this in answer to

Check · Review · Land · Live done — Landed and live in production.

Merged

I fixed the flaky test by measuring it over five runs instead of two. I didn't reproduce the original failure, so I haven't confirmed that this is the cause. The test counts the SQL statements needsYouCard costs on / at 5 repos and again at 30.

Notes

opened this

I fixed the flaky test by measuring it over five runs instead of two. I didn't reproduce the original failure, so I haven't confirmed that this is the cause.

The test counts the SQL statements needsYouCard costs on / at 5 repos and again at 30. It called the statements helper with runs = 2, while the helper's default is 5. The helper keeps the fewest statements over the runs, because background work in the same process (a sweep, a late fire-and-forget write) only ever adds statements. With two runs, noise can land in both and make large differ from small. That fits a failure under load that passes when the test runs alone.

The change is in test/surfaces-adversarial.test.ts: both calls now pass 5, and the comment says why. The file passes locally (13 tests, 0 fail). I haven't run bun x tsc --noEmit, and the forge runs the full check on push.

I did not change the other statements(..., 2) callers in that file (lines 354, 359, 426, 431, 520, 525, 591, 599), which have the same weakness. Nothing in the issue shows them failing.

gate.ts --fix left one note: a comment line over 100 columns in this file that I didn't wrap. It says the nightly rewrap handles it on main.

This is a test-only change, so there is no web page, action or route to try and no review block.

Closes #16506

commented

I fixed the flaky test by measuring it over five runs instead of two. I didn't reproduce the original failure, so I haven't confirmed that this is the cause.

The test counts the SQL statements needsYouCard costs on / at 5 repos and again at 30. It called the statements helper with runs = 2, while the helper's default is 5. The helper keeps the fewest statements over the runs, because background work in the same process (a sweep, a late fire-and-forget write) only ever adds statements. With two runs, noise can land in both and make large differ from small. That fits a failure under load that passes when the test runs alone.

The change is in test/surfaces-adversarial.test.ts: both calls now pass 5, and the comment says why. The file passes locally (13 tests, 0 fail). I haven't run bun x tsc --noEmit, and the forge runs the full check on push.

I did not change the other statements(..., 2) callers in that file (lines 354, 359, 426, 431, 520, 525, 591, 599), which have the same weakness. Nothing in the issue shows them failing.

gate.ts --fix left one note: a comment line over 100 columns in this file that I didn't wrap. It says the nightly rewrap handles it on main.

This is a test-only change, so there is no web page, action or route to try and no review block.

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs