Repository navigation
fix: two unreliable Core tests, and run every suite in CI - #1120
Merged
evrydayjunglist merged 3 commits intoNov 18, 2026
Merged
Conversation
DisposeAsync cancels and then stops the listener. An accept that started between the two failed with ObjectDisposedException instead of the cancellation, out of DisposeAsync (19 of 3000 start-connect-dispose cycles here; HostTests failed on the CI runner about one run in four).
The release rode on the thread pool. With every pool thread busy it came after the save's two seconds of patience, and the test that expects the save to succeed failed (reproduced with a busy pool: 3 of 3).
A failing suite stopped the job, so the suites after it, the Gateway one with the lookup guard among them, did not run.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes
The first batch of runs of the Tests workflow (#1118), on 15 pull requests at once, failed on 4 of them in the Core suite, on two tests that none of those pull requests touches. Both were reproduced locally before any change. One is a race in server code, the other a flaw in a test helper; the workflow also stops hiding later suites behind a failing one.
997680ff9fix: end the dev host's accept loop when it is stopped mid-acceptHostTests.Bad_Input_Is_Rejected_Not_Fatalfailed withObjectDisposedExceptionfromGameHost.AcceptLoop, out ofDisposeAsync(#1086, #1110 twice, #1116).DisposeAsynccancels the token and then stops the listener. An accept that starts between the two, or is cut off by the stop, fails with the socket's own exception instead ofOperationCanceledException, which was the only one the loop treated as shutdown. The loop now ends on any accept failure once cancellation has been requested.Reproduced with 3000 start-connect-dispose cycles in one test: 19 threw before the change, 0 after (three runs).
f307ff7e9test: release a held file from a thread of its ownJsonAccountStoreTests.A_change_while_the_account_store_is_briefly_held_is_savedfailed withUnauthorizedAccessExceptionfromSaveFiles.Write(#1053, #1116).The test holds the file for 300 ms and expects the save to wait for it.
FileHoldreleased the file withTask.Delay(ms).ContinueWith(…), on the thread pool. With every pool thread busy, the release came after the save's two seconds of patience, so the save gave up as it is meant to. The server's retry is not at fault. The release now runs on its own background thread.Reproduced by keeping every pool thread busy on the CPU for four seconds around the hold: failed 3 of 3 before the change, passed 3 of 3 after. It is the only wait on real time in the test projects.
fa5fbbf32ci: run every suite when the build workedA failing suite ended the job, so on those four pull requests the Gateway suite, with the lookup guard from #1118, never ran. The Core and Gateway steps now run whenever the build step succeeded (
!cancelled() && steps.build.outcome == 'success'); the job still fails if any suite fails.Layer
Framework, tests and repository controls.
src/GameServer.Host/GameHost.cs(the JSON-lines dev host; no game rule).tests/GameServer.Core.Tests/FileHold.cs..github/workflows/tests.yml.Issue
No issue. Closes nothing.
Checks
main:578795180fa5fbbf32dotnet build GameServer.slnx(0 warnings, 0 errors)Not checked: the two fixes on a GitHub machine beyond this pull request's own run. The failures there were about one run in four, so one green run does not show much; a batch of runs after merging will.
For the reviewer
sql/.github/CODEOWNERS:.github/workflows/tests.yml(twoif:conditions and a step id)