jmx-dev RFR 8031559: javax/management/monitor/StartStopTest.java fails intermittently

Daniel Fuchs daniel.fuchs at oracle.com
Mon Jan 20 08:12:56 PST 2014


Hi Jaroslav,

Looks good.

If the test fails again you might consider using
a CountDownLatch - or something like that - instead of
a simple volatile boolean. It would allow you to use
<http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/CountDownLatch.html#await(long,%20java.util.concurrent.TimeUnit)>
in the loop and remove the first doSleep() at line 154.

I'm afraid I don't have anything better than sleep for the
second call at line 166 anyway.

Let's keep what you have now and see if it completely solve
the issue.

-- daniel

On 1/20/14 4:41 PM, Jaroslav Bachorik wrote:
> Please, review the following test change.
>
> Issue : https://bugs.openjdk.java.net/browse/JDK-8031559
> Webrev: http://cr.openjdk.java.net/~jbachorik/8031559/webrev.00
>
> The test fails intermittently - the "called" flag it is using to
> indicate that a workload was successfully processed is not volatile or
> synchronized and is set from a different thread than the one which
> checks it. This can lead to race conditions making the test fail. The
> other test improvement is to honor the "test.timeout.factor" property to
> properly scale any timeouts used in the test.
>
> Thanks,
>
> -JB-



More information about the jmx-dev mailing list