carlos / platform Public

fix-edge-burst-flake

Fix the TestBurstSingleKeyFloodBounded flake in internal/edge (discussion #1387; it failed on main at bac71e00 and on several branches on 2026-11-25).

Cause: the test counted allocations with testing.AllocsPerRun, which counts the whole process. Goroutines left by earlier tests were in that count. The one caught: TestHeldDialClientCancelReturnsAtOnce. Its client gives up after 100 ms, but http.Transport finishes a dial it has started even after the request is cancelled, so the edge's local-dial hold keeps redialling a dead port every 100 ms for 2 s. Run straight after that test, the old check failed 196 of 200 times (100 to 155 allocations); on its own it passed 400 of 400.

Fix (test only): allocsUnder sets MemProfileRate to 1 and counts only the allocations whose stack passes through its own frame. The limit stays at 10. The warming pass must count above zero, so a broken measurement cannot pass. A mutation that allocated once every 50,000 notes was counted exactly (20) and failed.

After the fix: the same pairing passed 200 of 200, the test alone passed 400 of 400, and three shuffled full-package runs passed. make code-health and make staticcheck are clean.

Commits 1
Discussions 0 0 open
Tasks 0/0 done

Discussions

  • No discussions on this branch yet.

Tasks

  • No tasks yet.

Activity