check / check (push) Waiting to run
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 first. A new test hands over a full batch while a write is held; it fails about half its runs on the old code. TestPrefixHandlerSkipsItsLastWriteAfterTheStopDeadline and TestPrefixHandlerStopLogsTheTableChangesLeftUnwritten also failed when the flush timer fired between two of their steps. Both now give the handler a timer interval longer than the test. Model: opus-5-5