Every other reporter test reaches Stop() without a Start(), so the drain task was never exercised and the Task<ValueTask> defect passed the whole suite while doing nothing. Race the drain against a delay: with an empty queue the loop parks on WaitToReadAsync forever, so a correctly unwrapped task cannot win that race, while the Task<ValueTask> completed in ~0ms. Then assert Stop() does not return until the loop has actually exited, which is the precondition the flush relies on before reading the SingleReader channel. Verified by reverting DrainLoop to ValueTask: the test fails. A slow pool can only make it under-detect, never fail spuriously. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| Application | ||
| BuildTool | ||
| Logger | ||
| Server | ||
| Server.Tests | ||
| UOContent | ||
| UOContent.Tests | ||