carlos / platform Public

Flaky: asset e2e unsized oversized test timed out on main 80385b81 Issue closed

On branch fix-asset-e2e-unsized-flake

Job: the push run on main at 80385b819c415af8210a1abcdff21cd3b9e127b1, which ended 00:53:27Z on 2026-11-07 in the gate step after 414 s. The release agent places it as the job just before 5008. Job 5008, the rerun at the same commit, passed.

Failure: internal/edge TestAssetE2EOversizedResponseIsStoredNowhere//assets/unsized.js (30.00s), assete2etest.go:1347: read body of https://shop.example.com/assets/unsized.js: context deadline exceeded (Client.Timeout or context cancellation while reading body). The package took 353 s.

Cause: the unsized case is the only one that writes to disk. Each edge, home and far, reserves the full cap for an unknown length and streams assetcache.MaxBody (32 MiB) into a fill temp file before the cap stops it. That is 64 MiB of writes plus about 100 MiB over TLS, all inside the test client's 30 s timeout.

  • Locally the subtest takes 0.1 s. It passed 0/200 failures alone and 0/200 under 8-way contention with GOMAXPROCS=2, so CPU load alone does not explain it.
  • With writes throttled to 1 MiB/s by a throwaway sleep in Fill.Write, it fails 3/3 at exactly 30.00 s with the CI error. The sized case never reserves, so it stays at 0.1 s.
  • The code under test does not block anywhere: Reserve never waits, and Fill.Write and the fill writer's tee have no waits. So this is a slow disk under a saturated gate, not a hang in the fill.

Fix (branch fix-asset-e2e-unsized-flake): assetcache.MaxBody becomes a variable that a test can shorten, following the same pattern as assetFillDeadline. The test sets it to 1 MiB and sends the cap plus 512 KiB. That takes the same production paths, the header-time refusal and the write-path stop, with 1/32 of the I/O.

  • Under the same 1 MiB/s throttle it passed 200/200 at about 1.1 s.
  • A mutation that drops the cap check in Fill.Write turns it red, because the home store then holds the entry.
  • The census needs an envelope re-pin for internal/assetcache, which is in the overlay. fill.go is line-neutral.
LLM

Not a product hang: 64 MiB of cache writes on a loaded runner outran the client's 30 s. Fix shortens the cap in the test.

Merged to main as baf506ea4484e8e28d54ff28213c41c43818a4f7, a squash of 7464320e, and mirrored to GitHub. Branch CI passed on the tip. Astra review: READY, no findings. Census envelope approved on #280. It ships in the next release; v0.34.17 was cut from 80385b81 without it.