Skip to content

test: connect the bot only after the nether forceload has finished - #4050

Closed
u9g wants to merge 1 commit into
test/cheap-nether-genfrom
test/cheap-nether-gen-wait
Closed

test: connect the bot only after the nether forceload has finished#4050
u9g wants to merge 1 commit into
test/cheap-nether-genfrom
test/cheap-nether-gen-wait

Conversation

@u9g

@u9g u9g commented Sep 5, 2026

Copy link
Copy Markdown
Member

Stacked on #4037 (test/cheap-nether-gen); fixes the failure that has made its CI red three times.

Why #4037 fails

The warm-up forceload blocks the server's main thread until all 49 nether chunks are FULL. Status pings are answered off-thread, so pingUntilReady resolves while the main thread is still generating, and the bot connects into a server that cannot process its login. Netty's ReadTimeoutHandler(30) runs on the IO thread, so a login-phase connection that has sent login_start and heard nothing for 30s is dropped regardless of what the main thread is doing. Whether a version fails is just whether the stall crosses 30s on that runner:

run stall result
33919891284 1.16.5 32.3s GameProfile ... lost connection: Timed out, before-all hook fails
same run, 1.18.2 / 1.19 32.0s / 31.9s same
33905032370 1.16.5 20.4s passed
same run, 1.18.2 30.9s failed

Change

test/externalTest.js waits for the console's Marked N chunks in minecraft:the_nether ... to be force loaded line as well as the ping before begin(), so no connection exists while the main thread is blocked. Versions without the execute command (pre-1.14) skip the wait and are unchanged. The stall still lands inside the hook's budget, as #4037 intended.

Verification

Local, nether test only, with another server running on the same box:

version forceload stall nether
1.12.2 (no forceload) - pass
1.16.5 8s pass, 5295ms
1.21.8 26s, bot connected after pass, 9574ms

The log order is now Marked 49 chunks -> pong -> starting bot on every forceload version.

The warm-up forceload blocks the server's main thread until all 49 nether
chunks are FULL. Status pings are answered off-thread, so pingUntilReady
resolved while the main thread was still generating, and the bot connected
into a server that could not process its login. When generation took more
than 30s the login-phase connection hit netty's ReadTimeoutHandler(30) and
the whole version failed in the before-all hook ("lost connection: Timed
out" on the GameProfile). CI hit this three times on 1.16.5-1.19.3 with
30.9-32.3s stalls; versions where the stall stayed near 20s passed.

Wait for the console's "Marked N chunks in minecraft:the_nether" line as
well as the ping before begin(), so no connection exists while the main
thread is blocked. Versions without the execute command skip the wait.
@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):

   3498ms ->    8708ms  mineflayer_external 1.16.5v fishing

@u9g u9g closed this Sep 6, 2026
@u9g
u9g deleted the test/cheap-nether-gen-wait branch September 6, 2026 13:11
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.

1 participant