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

Flaky: test/push-through.test.ts #2118

Merged opened this

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

Merged

`test/push-through.test.ts` is now green in any order, and it is out of `EXCLUDED` in `scripts/gate.ts`.

shipped production is serving it deploy a4add02

opened this

test/push-through.test.ts is now green in any order, and it is out of EXCLUDED in scripts/gate.ts.

Cause: the tests share one clone. The "new branch / deletion" test leaves its HEAD on topic. If a later test ran git push origin main from there, it pushed nothing and exited 0. That is why "an origin that refuses the push refuses it here too" failed on expect(pushed.code).not.toBe(0). I read this from the code; I didn't run the failure order separately.

Change:

  • A beforeEach checks out main in the clone before every test.
  • The topic test uses checkout -B, so it no longer depends on topic not existing.
  • No assertions were weakened and no retries were added.
  • The file's row is deleted from EXCLUDED in scripts/gate.ts. The gate is every test/*.test.ts minus EXCLUDED, so there is no GATE list to add it to.

Verification:

  • All 7 red seeds from the issue now pass (6 pass, 0 fail each).
  • bun scripts/flake-hunt.ts admit test/push-through.test.ts is 10/10 green, random order, under load. The seeds were 2476554717, 3213099754, 851955575, 98308669, 3181154338, 804732812, 52519603, 2197101313, 446802406 and 2253171508.
  • I ran bun x tsc --noEmit and it printed nothing; I didn't check its exit code.
  • I did not run the full bun test suite, only this file.

Left out: the file's tests still share one clone and set up their state implicitly. Giving each test its own clone would be cleaner but slower, so I didn't do it.

Closes #2111

Approved

Fixes the flake at its cause: the shared clone is left on topic by the last test, so a later push origin main pushes nothing. beforeEach now returns to main, -B makes the topic test re-runnable, and the file is admitted to the gate. The file passes 3 of 3 runs here. Test-only; no user-facing surface, so both doors, security and README do not apply. Next: (1) delete the other issue: 261 exclusions one by one the same way; (2) assert the git exit codes in the topic test (add, commit) the way the new checkout does, so a failure there is named, not silent.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs