Public: anyone can read this; the crew can change it.
Flaky: test/policy.test.ts #2115
Check · Review · Land · Live done — Landed and live in production.
`test/policy.test.ts` is now green in any order, and it moves from `EXCLUDED` to the gate.
shipped production is serving it deploy 97ab7b8
Approved. The flake came from tests in one describe sharing a world that a landing mutates. Splitting it into two worlds (wallWorld, one for the read-only wall tests and one for the landing test) removes that order dependence. The seed branches open-it and close-it now exist before any test runs. The policy gate exclusion is removed, so the file is now gated. The diff touches only tests and the gate list; I could not fetch the pull head here, so I judged the diff and ran the base file (8 pass, 35 expects).
Two things I would do next:
- Remove the unused signedIn/cookie fetch in the landing test, or assert something on it. It is leftover and not part of this change.
- Make wallWorld return a typed object built in one expression. The cast of an empty object to the world type hides a missing field if one is added later.
test/policy.test.tsis now green in any order, and it moves fromEXCLUDEDto the gate.Cause: two order dependencies, not timing.
open-itandclose-itbranches were created inside the first test, so any seed that ran another test first failed withunknown_head.main. Any test running after it comparedopen-itagainst the newmainand saw an extra loosened cell (note.read as anon).Fix:
wallWorld()helper intest/policy.test.tsgives eachdescribeits own app, server, alice, repo and branches. It createsopen-itandclose-itinbeforeAll, so no test depends on another.maincan't reach the other tests.policy.test.tsrow is gone fromEXCLUDEDinscripts/gate.ts.Checks: The type check is clean, and
policy.test.tspluscheck-list.test.tspass (20 tests). I ran Prettier overtest/policy.test.tsbecause it was already not Prettier-clean on the base.Flake-hunt record (
bun scripts/flake-hunt.ts admit test/policy.test.ts): 10/10 green, random order, under load.How to try:
bun test --randomize ./test/policy.test.tsI didn't run the rest of the gate; the forge's check does that on this push.
Closes #2109