test: retry the vanilla ping while the server has no status yet - #1524
Open
u9g wants to merge 1 commit into
Open
test: retry the vanilla ping while the server has no status yet#1524u9g wants to merge 1 commit into
u9g wants to merge 1 commit into
Conversation
minecraft-wrap resolves startServer on the "Done" log line, which vanilla prints inside initServer() before runServer() builds its ServerStatus. Since 1.19.4 the handshake listener runs on the Netty thread and closes a STATUS request that arrives while getStatus() is still null, so the "pings the server" test intermittently failed with "Connection closed before the server sent a status response" (three unrelated 26.1 runs in the last three days). Retry that specific error for a bounded number of attempts instead of pinging exactly once.
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.
Problem
The
client <version>v > offline > pings the servertest fails intermittently on CI with:It hit three unrelated 26.1 runs in the last three days (the mocha 12 dependabot bump, #1521, and #1523). Before #1514 this case hung until the 120 s
closeTimeoutinstead of failing fast, which is why it used to show up as a slow test rather than a red job.Cause
It's a startup race in vanilla that the test harness's readiness check exposes:
startServeras soon as the server logs theDone (...)!line, and the test pings immediately.DedicatedServer.initServer(), but only builds itsServerStatusafterwards inMinecraftServer.runServer()(after also stat'ing the favicon).ServerHandshakePacketListenerImpl.handleIntentionruns on the Netty thread and, for a STATUS intent whilegetStatus()is still null, callsconnection.disconnect(IGNORE_STATUS_REASON). In the status state that is a bare socket close with no packet.In the failing logs the ping lands within the same millisecond as
started server; in passing runs there is ~90 ms of slack.Fix
Only the ping test is affected (the login path does not check the status object), so the test now retries that specific error for a bounded number of attempts with a short delay, instead of pinging exactly once. Any other error, or exhausting the attempts, still fails the test.
src/ping.jsis unchanged.Verified locally: the 26.1 test passes under Java 25, and against a fake server that closes the first three status requests after the handshake the helper recovers, while against one that always closes it gives up with the original error after the configured attempts.