Made sure the sleeping Runnable in ImmediateExecutorTest sleeps more than 1 sec

This commit is contained in:
Trustin Lee 2009-03-22 15:09:40 +00:00
parent cceab617b0
commit acf7a9d46f

View File

@ -42,15 +42,18 @@ public class ImmediateExecutorTest {
long startTime = System.nanoTime();
e.execute(new Runnable() {
public void run() {
long startTime = System.nanoTime();
for (;;) {
try {
Thread.sleep(1000);
break;
} catch (InterruptedException e) {
// Ignore
}
if (System.nanoTime() - startTime >= 1000000000L) {
break;
}
}
}
}
});
assertTrue(System.nanoTime() - startTime > 900000000L);
}