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

Full suite red: test/security-floor-routes.test.ts #17442

shipped production is serving it opened this has it

Landed in pull #17443 · run

opened this

_Filed by the scheduled full-suite report, not written by a person. It holds no pull, batch or release._

test/security-floor-routes.test.ts failed in the full suite on main (check run 01m8ttep5h970zskcgsy04c832, baf03ad).

  • every GET route of the other pages, and an unknown path, carries the floor signed out took 2.15 s of CPU, over the 2 s test budget: make it faster, or name its file in SLOW in scripts/gate.ts with an issue

To reproduce:

bun test ./test/security-floor-routes.test.ts
bun test ./test/security-floor-routes.test.ts --rerun-each 10

The full suite ran it in shard 84/4763, 6 files at a time.

Files: test/security-floor-routes.test.ts

commented

#17443 fixes the symptom on one part only. The cause is still on main.

Evidence. Bisect run 01m8tvsmkyddrz6563dvjnk24a ran this file alone. Two tests went over budget, both signed out: "repository pages" at 3.08 s of CPU and "other pages" at 2.43 s. In the full suite on baf03ad, "other pages" signed out took 2.15 s. In every run, each part's signed-in walk passed, and it requests the same paths.

Cause. Since #17313, every route family imports its module on the first request to it (lazyRoutes). Each part's signed-out test runs first, so it pays every import and the first JIT. The signed-in test after it walks the same paths warm. Splitting "other pages" in half only spread that one-time cost over two tests. "Repository pages" is the file's very first walk, and it is still over budget whenever it runs cold.

Fix. Pay the imports in setup, not in a test. At the end of beforeAll in test/security-floor-routes.test.ts (its 30 s timeout covers this):

  // The first request to a lazy route family imports its module (#17313): the file's setup pays that,
  // so each walk below spends its 2 s on its own requests. Signed in and pages only, so no tokenless
  // or token allowance a later test counts on is spent.
  await pool(PART_NAMES.filter((part) => part !== "API").flatMap(pathsOf), (path) => floor(path, { cookie }));

PART_NAMES, pathsOf and floor are module consts that are already defined when the hook runs. fill is set just above.

How to confirm. Before the change, bun test ./test/security-floor-routes.test.ts alone shows "repository pages … signed out" over 2 s, as the bisect run did. After it, both of each part's tests are under 2 s.

I couldn't run this myself because this environment can't reach the forge's git, so the patch is untested. Once it holds, the two halves from #17443 can go back to one part.

Sign in to join this conversation.

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

Keyboard shortcuts

Docs