puniverse / quasar

Fibers, Channels and Actors for the JVM
http://docs.paralleluniverse.co/quasar/
Other
4.56k stars 575 forks source link

Fix resource leaks in tests #268

Closed felixvf closed 6 years ago

felixvf commented 7 years ago

Many tests create their own FiberScheduler. These objects do not seem to get reclaimed automatically (at least under OpenJDK 1.8.0), and each FiberScheduler entails at least one Thread. Hence, when testing everything at once, the number of Threads overwhelm the system and more Threads cannot be created, leading to OutOfMemoryErrors and thus test failures. However, the tests themselves would complete without failure if they were executed in isolation.

This fixes this issue by making the tests clean up after themselves.