ModernUO/Projects/UOContent.Tests
Kamron Batman 0f64d834b4
test(crowdsec): pin the drain task to the loop's lifetime
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>
2026-07-25 11:11:48 -07:00
..
Fixtures feat(network): wire ban channel + blocklist into the accept path; threading policy 2026-07-23 20:38:23 -07:00
Tests test(crowdsec): pin the drain task to the loop's lifetime 2026-07-25 11:11:48 -07:00
UOContent.Tests.csproj fix: Bumps dependencies. (#2531) 2026-07-14 15:17:55 -07:00