Speed up furnace external test by fast-forwarding CookTime - #3990
Merged
Conversation
u9g
force-pushed
the
speed-up-furnace-test
branch
from
August 23, 2026 22:52
a37fca4 to
f6f0bd9
Compare
Member
|
CI fails |
u9g
force-pushed
the
speed-up-furnace-test
branch
from
August 27, 2026 01:15
f6f0bd9 to
4b90ad1
Compare
u9g
force-pushed
the
speed-up-furnace-test
branch
3 times, most recently
from
August 27, 2026 02:08
2bff326 to
167b6ab
Compare
rom1504
reviewed
Aug 27, 2026
u9g
force-pushed
the
speed-up-furnace-test
branch
2 times, most recently
from
August 29, 2026 14:11
bdbb173 to
5726c84
Compare
Member
Author
|
Switched to |
u9g
added a commit
to u9g/minecraft-data
that referenced
this pull request
Aug 30, 2026
/blockdata was replaced by /data merge block in 1.13, and the furnace block entity's CookTime key was renamed cooking_time_spent in 1.21.4 (1.21.3 still accepts CookTime). Needed by PrismarineJS/mineflayer#3990 to fast-forward a furnace without hardcoding version comparisons.
rom1504
pushed a commit
to PrismarineJS/minecraft-data
that referenced
this pull request
Aug 31, 2026
/blockdata was replaced by /data merge block in 1.13, and the furnace block entity's CookTime key was renamed cooking_time_spent in 1.21.4 (1.21.3 still accepts CookTime). Needed by PrismarineJS/mineflayer#3990 to fast-forward a furnace without hardcoding version comparisons.
u9g
force-pushed
the
speed-up-furnace-test
branch
2 times, most recently
from
September 4, 2026 18:18
2d26020 to
cf15cea
Compare
The furnace test spent ~10s per version waiting out a real 200-tick smelt. Instead, after asserting the smelt has genuinely started (0 < progress < 1), merge CookTime:195s into the furnace block entity and wait for the output slot to populate — the output is still produced by the vanilla tick path, so all assertions are unchanged. Cuts the test from ~12s to ~3s per version, ~4.5 minutes across the matrix. The await runs 250-320ms on every tested version, so it uses a tight 500ms timeout: if the merge silently does nothing (wrong field name or command for a future version), the test fails fast instead of sitting out the real smelt. Verified against real servers on all 28 tested versions (1.21.4+ placement verified on top of PR #3960, which master needs for those versions regardless of this change).
Replaces the hardcoded version comparisons with hasDataCommand and furnaceNbtUsesSnakeCase (PrismarineJS/minecraft-data#1260).
u9g
force-pushed
the
speed-up-furnace-test
branch
from
September 4, 2026 21:11
cf15cea to
200fac9
Compare
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.
The furnace external test spent ~10s per version waiting out a real 200-tick smelt (
getStackCookTimeis a hardcoded 200 with no gamerule or recipe hook, all the way back to 1.8.8), making it the second-slowest test in the suite (~12.4s).This keeps the test end-to-end but skips the idle ticks: after the existing assertions that a real smelt is in progress (
0 < progress < 1), it mergesCookTime:195sinto the furnace's block entity and waits on the furnace window'supdateevent until the output slot populates, replacing thewait(progressSeconds * 1000 + 500)sleep. Both/blockdataand/data merge blockmerge into existing NBT, so the loaded input/fuel are untouched, and the output is still produced by the vanillatick()→craftRecipe()path — input decremented, fuel consumed — so every assertion is unchanged.Version details, verified empirically against real servers on all 28 tested versions:
cookTime == totalCookTimeexactly (not>=), so the merged value must stay below 200 — overshooting would cook forever./blockdatabecame/data merge blockin 1.13, andCookTimewas renamedcooking_time_spentin 1.21.4 (1.21.3 still acceptsCookTime; 1.21.4 does not).placeBlockon master today, with or without this change.The remaining 5 ticks complete in 250–320ms on every tested version, so the await uses a tight 500ms timeout as a guard: if a future version renames the field or command again, the merge is silently ignored and the test fails fast instead of sitting out the real 10s smelt.
Timing across the matrix: ~12s → ~3s per version (the cook await itself is 249–319ms on all 28 versions), roughly 4.5 minutes saved per full-matrix run.