Skip to content

Changes

Started 11 hr ago
Took 1 min 4 sec on Builder

Summary

  1. Fail fast when the registry bootstrap lookup pipeline is broken (commit: d96637f) (details)
  2. Fix test-order-dependent poisoning of Bukkit registry constants (commit: f6a6b90) (details)
Commit d96637f38a29f099b77b2b4ba2da7a8ac681a066 by nossr50
Fail fast when the registry bootstrap lookup pipeline is broken

The CI-only registry failure surfaces as NoClassDefFoundError in
every test after the first bootstrap, far away from the actual
break. Verify the pipeline right after Registry initializes: check
that Registry.EFFECT resolved through the bootstrap answer and that
a lookup on it mints a non-null instance, and throw a descriptive
IllegalStateException at the exact broken link instead of letting a
registry-backed class initializer read null and poison its class
for the whole JVM.
(commit: d96637f)
The file was modifiedsrc/test/java/com/gmail/nossr50/TestRegistryBootstrap.java (diff)
Commit f6a6b90211746758c351c341db7c31f21e1bbcd7 by nossr50
Fix test-order-dependent poisoning of Bukkit registry constants

SoundManagerTest answered Bukkit.getRegistry with bare Registry
mocks whose lookups return null. Whichever test first triggers
org.bukkit.Registry initialization welds its lookup results into
the Registry constants for the rest of the JVM, so when that test
ran before any TestRegistryBootstrap user (the CI runner listed the
util package before the skills package; Windows lists it after,
which is why this never reproduced locally), PotionEffectType read
a null lookup during its own initialization and 108 later tests
died with NoClassDefFoundError.

SoundManagerTest now serves registry lookups through
TestRegistryBootstrap, and MMOTestEnvironment bootstraps for every
harness test so no test ordering can initialize the registry
constants without the minting answer in place. Reproduced with
-Dsurefire.runOrder=reversealphabetical and verified green in both
orders on JDK 17 and JDK 25.
(commit: f6a6b90)
The file was modifiedsrc/test/java/com/gmail/nossr50/MMOTestEnvironment.java (diff)
The file was modifiedsrc/test/java/com/gmail/nossr50/util/sounds/SoundManagerTest.java (diff)