Bump @types/node to 25.2.1 + fix flaky time & nether tests#3828
Merged
rom1504 merged 4 commits intoPrismarineJS:masterfrom Feb 15, 2026
Merged
Bump @types/node to 25.2.1 + fix flaky time & nether tests#3828rom1504 merged 4 commits intoPrismarineJS:masterfrom
rom1504 merged 4 commits intoPrismarineJS:masterfrom
Conversation
Contributor
Author
|
flaky tests are still failing, working on them. |
Contributor
Author
|
Nice, CI is passing and the flaky tests are seemingly fixed. |
3 tasks
Member
|
Please rebase |
Bump @types/node to ^25.2.1 (from PrismarineJS#3821) and fix two flaky tests that were causing spurious CI failures: - time: disable daylight cycle during /time set assertions to prevent drift (e.g. expected 18000, got 21695) - nether: add stabilization wait after chunk loading on slow CI Co-authored-by: Cursor <cursoragent@cursor.com>
The 30s timeout for example tests covers child process spawn, server join, 5s stabilization wait, chunk loading, and the actual test. On slow CI runners this was too tight, causing spurious timeouts (e.g. exampleBee on 1.19.3). Co-authored-by: Cursor <cursoragent@cursor.com>
nether: Replace blind 1s wait with polling loop that checks for a solid block below before placing. Mocha's 90s test timeout is the backstop. runExample: Remove withTimeout wrapper (mocha handles overall timeout), remove 5s setTimeout before saying "loaded" (server command ordering guarantees the TP is applied before the chat message reaches the child), remove timeout from child join detection. This eliminates the premature "Promise timed out" failures on slow CI. testCommon: Increase base onceWithCleanup timeout from 5s to 20s for helper functions (gamemode change, teleport, clear inventory, etc.) to prevent spurious failures on slow CI while still providing useful error messages. Co-authored-by: Cursor <cursoragent@cursor.com>
The child bot's physics engine needs time to initialize at the teleported position (ground detection, etc.) before tests that require jumping (exampleDigger build) can work. Replace the removed blind 5s setTimeout with: 1. Condition-based poll for child entity at the TP target position 2. waitForTicks(60) for physics engine to settle (~3s game time) This is more robust than the original setTimeout because the entity check adapts to server speed and waitForTicks is tied to game ticks. Co-authored-by: Cursor <cursoragent@cursor.com>
18e8408 to
243d1d7
Compare
rom1504
reviewed
Feb 15, 2026
| const targetPos = new Vec3(50, bot.test.groundY, 0) | ||
| while (!bot.players[childBotName]?.entity || | ||
| bot.players[childBotName].entity.position.distanceTo(targetPos) > 5) { | ||
| await sleep(100) |
Member
There was a problem hiding this comment.
Much better to use events than this kind of checking every 100ms
Member
|
Merging as it looks like a strict improvement However the while wait for 100ms check is an anti pattern for mineflayer and we should use events or introduce appropriate ones if there are none. Would be great to fix in other PR or at least we should not reproduce this pattern in other places of the code base |
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.
Summary
Flaky test fixes
Test plan
Made with Cursor