Skip to content

test: read rain state only after login in the isRaining internal test - #4054

Merged
rom1504 merged 1 commit into
PrismarineJS:masterfrom
u9g:test/rain-flake-login
Sep 5, 2026
Merged

test: read rain state only after login in the isRaining internal test#4054
rom1504 merged 1 commit into
PrismarineJS:masterfrom
u9g:test/rain-flake-login

Conversation

@u9g

@u9g u9g commented Sep 5, 2026

Copy link
Copy Markdown
Member

Fixes the internal rain test 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.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 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 afterEach then waits forever for an end event that already fired.

Send the login packet on playerJoin and assert after the bot's login event, like the neighbouring internal tests do.

Reproduced locally by delaying the inject_allowed timer 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.

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.
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Tests more than 1.5x slower than master (durations are noisy, so this is informational):

   5718ms ->   12069ms  mineflayer_external 1.21.8v nether

@rom1504
rom1504 merged commit 8a2464a into PrismarineJS:master Sep 5, 2026
11 checks passed
@u9g
u9g deleted the test/rain-flake-login branch September 6, 2026 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants