Created
December 19, 2017 19:13
-
-
Save vorburger/775082c8b24b22cf0b69cba66744db12 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void testBasicWait() throws InterruptedException, ExecutionException { | |
long millis = 500; | |
final AtomicReference<Future<?>> futureRef = new AtomicReference<>(); | |
testAndVerifyTimeBounds(executorService -> | |
futureRef.set(executorService.submit(() -> { | |
try { | |
Thread.sleep(millis); | |
} catch (InterruptedException e) { | |
// Ignored | |
} | |
})), millis, 1000); | |
futureRef.get().get(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
==> https://git.opendaylight.org/gerrit/66624