neoforged / Bus

Event firing and listening framework, based on the event bus concept
GNU Lesser General Public License v2.1
3 stars 8 forks source link

Rework ModLauncher classloading hacks to preserve static fields between test runs #23

Closed Technici4n closed 11 months ago

Technici4n commented 11 months ago

Trust me, it works!

Same hack as before, but using the same TransformingClassLoader every time. This preserves static fields between test runs, and thus the thread pool from one of the tests is reused... this avoids spamming our TC server with new threads until it decides to fail the run due to excessive resource allocation.

JUnit added a nice launcher API that we could use if we wanted all tests to run with a specific class loader, but unfortunately we also want some tests (the NoLoader) to run with the normal app class loader.