SOLR-13479: Harden OverseerTaskQueueTest

This commit is contained in:
Jan Høydahl 2019-05-17 20:54:46 +02:00
parent b9db118ed3
commit 18cb42ee80

View File

@ -274,8 +274,8 @@ public class DistributedQueueTest extends SolrTestCaseJ4 {
// The 4th element in the queue will end with a "3". // The 4th element in the queue will end with a "3".
return child.endsWith("3"); return child.endsWith("3");
}).size()); }).size());
assertTrue(System.nanoTime() - start < TimeUnit.MILLISECONDS.toNanos(1000)); long timeTaken = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - start);
assertTrue(System.nanoTime() - start >= TimeUnit.MILLISECONDS.toNanos(250)); assertTrue("Time was " + timeTaken + "ms, expected 250-1500ms", timeTaken > 250 && timeTaken < 1500);
} }
private void forceSessionExpire() throws InterruptedException, TimeoutException { private void forceSessionExpire() throws InterruptedException, TimeoutException {