check / check (push) Canceled after 0s
When a write ran past the stop deadline, a full batch's wake-up or a tick could wait beside Stop's context. The flush goroutine's select picked one of them at random, so about half the time it wrote that batch after the deadline. That was the intermittent failure of TestPrefixHandlerSkipsItsLastWriteAfterTheStopDeadline. The flush goroutine now takes a waiting stop before anything else. A new test hands over a full batch while a write is held; it fails about half its runs on the old code. Model: opus-5-5