Bug 996037 - Forcing GC in tests causes them to fail on IBM jdk
Forcing GC in tests causes them to fail on IBM jdk
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: HornetQ (Show other bugs)
Unspecified Unspecified
unspecified Severity low
: ---
: ---
Assigned To: Clebert Suconic
Martin Svehla
Russell Dickenson
Depends On:
  Show dependency treegraph
Reported: 2013-08-12 05:28 EDT by Martin Svehla
Modified: 2013-09-05 11:11 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-08-20 12:00:21 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Martin Svehla 2013-08-12 05:28:30 EDT
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.
Comment 2 Miroslav Novak 2013-08-12 06:32:48 EDT
Pull request sent to HQ master:
Comment 3 Clebert Suconic 2013-08-12 10:27:10 EDT
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?
Comment 4 Martin Svehla 2013-08-13 09:55:57 EDT
@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.
Comment 6 Clebert Suconic 2013-08-13 11:00:20 EDT
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
Comment 7 Clebert Suconic 2013-08-20 12:00:21 EDT
I would raise issues by test.. or just fix by test.. we won't remove forceGC anyways

Note You need to log in before you can comment on or make changes to this bug.