RFR [8038333] java/lang/ref/EarlyTimeout.java failed

Mandy Chung mandy.chung at oracle.com
Sun Mar 30 04:20:44 UTC 2014


On 3/27/2014 6:36 AM, Ivan Gerasimov wrote:
> Now, I updated the webrev with the additional delay as you suggested:
> http://cr.openjdk.java.net/~igerasim/8038333/2/webrev/

Thanks for the updated patch, Ivan and also Peter for the suggestion to 
delay to give a chance for the threads to wait on the lock.

Ivan - I agree with you that there is no guarantee that one thread can 
remove the reference before the timeout.   With this patch, basically 
the test can only verify that the remove(timeout) must be >= timeout if 
no reference is in the queue.   That makes the test less interesting but 
it's a tradeoff with test stability.   I wonder if running this test in 
othervm would help increase the chance of enqueuing the reference after 
System.gc.

I think it's okay with your proposed patcht.  We should revisit this 
test in the future to see how we can improve the test for example 
something similar to what Peter suggests.  Can you file a bug for the 
test improvement so that we can look into that in the future?

BTW there is a typo in line 40 s/System.gs()/System.gc()/.  It'd be good 
to add a comment in line 66 to make it clear that the main thread waits 
until the threads has started and give it a chance for the threads to 
block on the queue.remove(timeout) call.

thanks
Mandy



More information about the core-libs-dev mailing list