The 18 BroadcastToPlayersInRange_* tests in BroadcastToPlayersInRangeTests.cs set up state via _zone.AddPlayerAsync(...).Wait() inside synchronous public void methods. SonarQube xUnit1031 flags blocking task operations in test methods.
Analysis: xUnit runs tests without a SynchronizationContext, so the classic .Wait()/.Result deadlock cannot occur here — the rules headline danger does not apply. But the fix is still a genuine, low-risk improvement: async Task + await is the idiomatic async-test pattern and surfaces assertion/exception failures directly instead of wrapping them in AggregateException. So this is a real (if minor) cleanup, not a false positive.
Change: method-aware conversion — only the 18 tests that actually block were converted to async Task with await; the one test with no async setup stays void (avoids a CS1998 async-without-await). Added using System.Threading.Tasks;.
Scope: one test file. Build clean (0 errors, no CS1998); all 34 test cases pass unchanged. Clears 27 of the 47 open xUnit1031 findings. SonarQube rule external_roslyn:xUnit1031.
Follow-up: remaining xUnit1031 live in BaseZoneTests (mixed sync/async) and a few others — deferred to keep this PR contained and verifiable.
The 18 `BroadcastToPlayersInRange_*` tests in `BroadcastToPlayersInRangeTests.cs` set up state via `_zone.AddPlayerAsync(...).Wait()` inside synchronous `public void` methods. SonarQube xUnit1031 flags blocking task operations in test methods.
**Analysis:** xUnit runs tests without a `SynchronizationContext`, so the classic `.Wait()`/`.Result` deadlock cannot occur here — the rules headline danger does not apply. But the fix is still a genuine, low-risk improvement: `async Task` + `await` is the idiomatic async-test pattern and surfaces assertion/exception failures directly instead of wrapping them in `AggregateException`. So this is a real (if minor) cleanup, not a false positive.
**Change:** method-aware conversion — only the 18 tests that actually block were converted to `async Task` with `await`; the one test with no async setup stays `void` (avoids a CS1998 async-without-await). Added `using System.Threading.Tasks;`.
Scope: one test file. Build clean (0 errors, no CS1998); all 34 test cases pass unchanged. Clears 27 of the 47 open xUnit1031 findings. SonarQube rule external_roslyn:xUnit1031.
Follow-up: remaining xUnit1031 live in BaseZoneTests (mixed sync/async) and a few others — deferred to keep this PR contained and verifiable.
Resolved in spikersoft-backend PR #368 (merged to master). Converted the 18 blocking BroadcastToPlayersInRange tests to async Task + await (xUnit1031); all 34 cases pass, zero behavior change. Unit Tests green; merged past the non-blocking notify step. Closing.
Resolved in spikersoft-backend PR #368 (merged to `master`). Converted the 18 blocking BroadcastToPlayersInRange tests to async Task + await (xUnit1031); all 34 cases pass, zero behavior change. Unit Tests green; merged past the non-blocking notify step. Closing.
Resolved in spikersoft-backend PR #366 (merged to master). Converted 18 blocking BroadcastToPlayersInRange tests to async Task + await (xUnit1031); all 34 cases pass, zero behavior change. All build/test contexts green; merged past the non-blocking notify job. Closing.
Resolved in spikersoft-backend PR #366 (merged to `master`). Converted 18 blocking BroadcastToPlayersInRange tests to async Task + await (xUnit1031); all 34 cases pass, zero behavior change. All build/test contexts green; merged past the non-blocking notify job. Closing.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
The 18
BroadcastToPlayersInRange_*tests inBroadcastToPlayersInRangeTests.csset up state via_zone.AddPlayerAsync(...).Wait()inside synchronouspublic voidmethods. SonarQube xUnit1031 flags blocking task operations in test methods.Analysis: xUnit runs tests without a
SynchronizationContext, so the classic.Wait()/.Resultdeadlock cannot occur here — the rules headline danger does not apply. But the fix is still a genuine, low-risk improvement:async Task+awaitis the idiomatic async-test pattern and surfaces assertion/exception failures directly instead of wrapping them inAggregateException. So this is a real (if minor) cleanup, not a false positive.Change: method-aware conversion — only the 18 tests that actually block were converted to
async Taskwithawait; the one test with no async setup staysvoid(avoids a CS1998 async-without-await). Addedusing System.Threading.Tasks;.Scope: one test file. Build clean (0 errors, no CS1998); all 34 test cases pass unchanged. Clears 27 of the 47 open xUnit1031 findings. SonarQube rule external_roslyn:xUnit1031.
Follow-up: remaining xUnit1031 live in BaseZoneTests (mixed sync/async) and a few others — deferred to keep this PR contained and verifiable.
Resolved in spikersoft-backend PR #368 (merged to
master). Converted the 18 blocking BroadcastToPlayersInRange tests to async Task + await (xUnit1031); all 34 cases pass, zero behavior change. Unit Tests green; merged past the non-blocking notify step. Closing.Resolved in spikersoft-backend PR #366 (merged to
master). Converted 18 blocking BroadcastToPlayersInRange tests to async Task + await (xUnit1031); all 34 cases pass, zero behavior change. All build/test contexts green; merged past the non-blocking notify job. Closing.