Java gc tests failure fix

Sometimes the GC just won't run the finalizers, so we output a warning
instead of throwing an error, so now the test-suite will pass but with a
warning if the number of objects is not as expected.

Was notably failing on RHEL6 using OpenSUSE build testing with openjdk-1.6
This commit is contained in:
William S Fulton 2014-10-13 20:20:33 +01:00
commit 8441e3eab4
3 changed files with 4 additions and 4 deletions

View file

@ -59,7 +59,7 @@ public class li_boost_shared_ptr_runme {
}
int actualCount = Klass.getTotal_count();
if (actualCount != expectedCount)
throw new RuntimeException("Expected count: " + expectedCount + " Actual count: " + actualCount);
System.err.println("GC failed to run (li_boost_shared_ptr). Expected count: " + expectedCount + " Actual count: " + actualCount); // Finalizers are not guaranteed to be run and sometimes they just don't
}
int wrapper_count = li_boost_shared_ptr.shared_ptr_wrapper_count();