Description of problem: Tests in HornetQ testsuite fail randomly on ibm jdk when calling forceGC() method in UnitTestCase#tearDown(). How reproducible: Run HQ testsuite on IBM jdk, 1.6 or 1.7 Actual results: Typical log of failed test: 03:21:55,704 INFO [org.hornetq.core.server] #test testAddHeadAndRemove org.hornetq.tests.unit.util.LinkedListTest::#test testAddHeadAndRemove Jumping 500 03:21:55,709 INFO [org.hornetq.core.server] #test forceGC 03:21:55,837 INFO [org.hornetq.core.server] #test forceGC Done [repeats many times] Additional info: As an example check LinkedListTest in unit tests or RealNodeManager test in integration. LinkedListTest fails because the list is (unexpectedly) already cleaned when forceGC() is called (the test still expects 999 objects in the list, but gets 0). While this particular test can be fixed by calling any method on the list after assertCount() call in the test (to force the list to still exist at that point), the issue seems to be more general tied calling System.gc(), hence why I'm opening this general bug.
Pull request sent to HQ master: https://github.com/hornetq/hornetq/pull/1207
We really need the force GC in a few tests to validate memory leaks. Perhaps we should just ignore such tests on IBM and not run them on IBM JDK since that would be irrelevant to validate the platform?
@Clebert I understand the forceGC needs to stay there. After discussion with Mirek, we would go with trying to fix it on test by test basis. If at all possible I would like to get to the point where the testsuite runs consistently on all supported platforms.
shouldn't we raise issue by test? it's hard to keep track of a generic task like this. We are not going to remove forceGC. I would rather ignore the test on IBM JDK than removing forceGC
I would raise issues by test.. or just fix by test.. we won't remove forceGC anyways