check / check (push) Waiting to run
The report buffer's stop now waits, through a sync.WaitGroup, for flushLoop and for the write Append starts at 10 MiB before its final flush. It used to return at once, so the process exiting cut such a write off and its reports were lost. A write under way that fails puts its reports back in the buffer, so the final flush writes them; the stop fails only if that flush fails too. Tests hold the periodic write and the one at 10 MiB open in a synctest bubble and find the stop waiting until each is released; a third makes the held write fail and finds its report written by the final flush. Model: opus-5-5