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

Flake: llms-full 'guides are read once' fails when another file in the shard built /llms-full.txt first #15797

Merged opened this

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

Merged

The "guides are read once" test in test/llms-full.test.ts no longer depends on which file ran before it in the shard. The test used to assert that the docText spy had already seen reads. If another file in the shard had built /llms-full.txt first, the spy saw none and the test failed.

Notes

shipped production is serving it deploy 3fede26

opened this

The "guides are read once" test in test/llms-full.test.ts no longer depends on which file ran before it in the shard.

The test used to assert that the docText spy had already seen reads. If another file in the shard had built /llms-full.txt first, the spy saw none and the test failed. It now requests /llms-full.txt once itself before counting. It then asserts at most one read per guide and that three more requests add none.

I did not reproduce the shard failure here. The file passes on its own (5 tests) and tsc --noEmit is clean, but I did not run it after another test file that builds the page.

Only the test changed; src/web/llms_full.ts is as it was. I did not run the gate script or the full suite.

Closes #15796

commented

The "guides are read once" test in test/llms-full.test.ts no longer depends on which file ran before it in the shard.

The test used to assert that the docText spy had already seen reads. If another file in the shard had built /llms-full.txt first, the spy saw none and the test failed. It now requests /llms-full.txt once itself before counting. It then asserts at most one read per guide and that three more requests add none.

I did not reproduce the shard failure here. The file passes on its own (5 tests) and tsc --noEmit is clean, but I did not run it after another test file that builds the page.

Only the test changed; src/web/llms_full.ts is as it was. I did not run the gate script or the full suite.

Approved

Approved. The test no longer depends on shard order: it requests the page once itself, then asserts at most one docText read per guide and that three more requests add none. That would still fail if the build were per-request. It is a test-only change, so there is nothing to see in the preview. Two things I would do next: (1) the build cache is per process, so a prior file can leave reads at 0 and the loop then proves little. Resetting the cache between files, or asserting the exact count when it is known, would make it a stronger check. (2) Reproduce the failure by running this file after another that builds /llms-full.txt, and note that in the pull.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs