Skip to content

Comments

Bump @types/node to 25.2.1 + fix flaky time & nether tests#3828

Merged
rom1504 merged 4 commits intoPrismarineJS:masterfrom
plainprince:dependabot/types-node-25
Feb 15, 2026
Merged

Bump @types/node to 25.2.1 + fix flaky time & nether tests#3828
rom1504 merged 4 commits intoPrismarineJS:masterfrom
plainprince:dependabot/types-node-25

Conversation

@plainprince
Copy link
Contributor

@plainprince plainprince commented Feb 8, 2026

Summary

Flaky test fixes

  • time test: Daylight cycle was left enabled during `/time set` assertions, so time would drift between the command and the check (e.g. expected 18000, got 21695). Fix: disable daylight cycle before time transition tests, re-enable only for progression/toggle sections.
  • nether test: `placeBlock` timed out on slow CI waiting for `blockUpdate` right after chunk loading. Fix: add a 1s stabilization wait after `waitForChunksToLoad()`.

Test plan

  • Lint passes
  • Time test passes consistently across all versions
  • Nether test passes on 1.15.2
  • No regressions on other tests

Made with Cursor

@plainprince
Copy link
Contributor Author

flaky tests are still failing, working on them.

@plainprince
Copy link
Contributor Author

Nice, CI is passing and the flaky tests are seemingly fixed.

@plainprince plainprince mentioned this pull request Feb 9, 2026
3 tasks
@rom1504
Copy link
Member

rom1504 commented Feb 13, 2026

Please rebase

Simeon Kummer and others added 4 commits February 14, 2026 15:07
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>
@plainprince plainprince force-pushed the dependabot/types-node-25 branch from 18e8408 to 243d1d7 Compare February 14, 2026 14:07
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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much better to use events than this kind of checking every 100ms

@rom1504
Copy link
Member

rom1504 commented Feb 15, 2026

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

@rom1504 rom1504 merged commit 8968659 into PrismarineJS:master Feb 15, 2026
31 checks passed
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