diff --git a/src/test/java/org/jboss/threads/DeferredInterruptTestCase.java b/src/test/java/org/jboss/threads/DeferredInterruptTestCase.java index 07ea4ab..871b89f 100644 --- a/src/test/java/org/jboss/threads/DeferredInterruptTestCase.java +++ b/src/test/java/org/jboss/threads/DeferredInterruptTestCase.java @@ -24,7 +24,12 @@ public void testDeferral() throws Exception { public void run() { Thread.interrupted(); latch1.countDown(); + // now wait LockSupport.parkNanos(3000000000L); + if (! Thread.currentThread().isInterrupted()) { + // spurious unpark, perhaps + LockSupport.parkNanos(3000000000L); + } delivered0.set(Thread.interrupted()); JBossThread.executeWithInterruptDeferred(new Runnable() { public void run() {