Fix for starvation issue when running this test under newer JDKs