ModernUO/Projects/UOContent.Tests/Tests/Network
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
..
Bans test(crowdsec): pin the drain task to the loop's lifetime 2026-07-25 11:11:48 -07:00
Firewall refactor(network): move Firewall to UOContent; core keeps only the filter seam 2026-07-25 01:18:42 -07:00
Packets feat: Upgrades networking to use io_uring. (#2315) 2026-02-01 16:02:32 -08:00