test: read rain state only after login in the isRaining internal test - #4054
Merged
Conversation
The rain test asserted bot.isRaining inside the server's playerJoin handler. Plugins inject on inject_allowed, which the loader emits from a zero-delay timer, so on a slow CI runner the offline login handshake can finish first and the assert sees undefined. The throw happens inside the minecraft-protocol login flow, the fake server kicks the bot, and the afterEach hook then waits forever for an end event that already fired. Master has hit this on 1.9.4, 1.10.2, 1.13.2 and 1.19.3 since PrismarineJS#4032 merged. Send the login packet on playerJoin and assert after the bot's login event, like the neighbouring internal tests do.
Contributor
|
Tests more than 1.5x slower than master (durations are noisy, so this is informational): |
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.
Fixes the internal
raintest flake that has been failing master since #4032 merged (seen on 1.9.4, 1.10.2, 1.13.2 and 1.19.3, e.g. https://github.com/PrismarineJS/mineflayer/actions/runs/33949323353 and #4053's run https://github.com/PrismarineJS/mineflayer/actions/runs/33958790296).The test asserted
bot.isRaininginside the server'splayerJoinhandler. Plugins inject oninject_allowed, which the loader emits from a zero-delay timer, so on a slow runner the offline login handshake can finish first and the assert seesundefined. The throw happens inside the minecraft-protocol login flow, the fake server kicks the bot, andafterEachthen waits forever for anendevent that already fired.Send the login packet on
playerJoinand assert after the bot'sloginevent, like the neighbouring internal tests do.Reproduced locally by delaying the
inject_allowedtimer by 30ms: the old test fails with the CI error, the new one passes. Ran the test on 1.9.4, 1.13.2, 1.19.3 and 1.21.4, plus the full 1.13.2 internal suite.