From 889cc4fc5c99a94cbb1e23107d8a763963b4dc0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Fri, 17 May 2019 20:54:46 +0200 Subject: [PATCH] SOLR-13479: Harden OverseerTaskQueueTest (cherry picked from commit 18cb42ee80854e2159201fe550b13d894425a4f8) --- .../src/test/org/apache/solr/cloud/DistributedQueueTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/solr/core/src/test/org/apache/solr/cloud/DistributedQueueTest.java b/solr/core/src/test/org/apache/solr/cloud/DistributedQueueTest.java index c67f79e86b7..7b9ae11cb40 100644 --- a/solr/core/src/test/org/apache/solr/cloud/DistributedQueueTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/DistributedQueueTest.java @@ -274,8 +274,8 @@ public class DistributedQueueTest extends SolrTestCaseJ4 { // The 4th element in the queue will end with a "3". return child.endsWith("3"); }).size()); - assertTrue(System.nanoTime() - start < TimeUnit.MILLISECONDS.toNanos(1000)); - assertTrue(System.nanoTime() - start >= TimeUnit.MILLISECONDS.toNanos(250)); + long timeTaken = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - start); + assertTrue("Time was " + timeTaken + "ms, expected 250-1500ms", timeTaken > 250 && timeTaken < 1500); } private void forceSessionExpire() throws InterruptedException, TimeoutException {