Remove racy but unnecessary assertion

This commit removes a racy but unnecessary assertion in scaling thread
pool idle test. Namely, the main test thread can reach the removed
assertion before the last few threads in the thread pool have completed
their tasks and caused the completed tasks count on the underlying
executor to be updated. But this assertion is unnecessary. The main test
thread already waits on a latch that is only decremented immediately
before a task completes. This ensures that it was in fact the case that
every submitted task was executed.

Closes #18072
This commit is contained in:
Jason Tedor 2016-04-29 16:15:45 -04:00
parent 262a814c8d
commit c82e564886
1 changed files with 1 additions and 1 deletions

View File

@ -27,6 +27,7 @@ import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Executor;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.function.BiConsumer;
@ -193,7 +194,6 @@ public class ScalingThreadPoolTests extends ESThreadPoolTestCase {
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
assertThat(stats(threadPool, threadPoolName).getCompleted(), equalTo(128L));
}));
}