Skip to content

Commit

Permalink
Fix PrioritizedThrottledTaskRunnerTests
Browse files Browse the repository at this point in the history
These tests try and execute `maxThreads` concurrent tasks to ensure that
the rest of the executor's queue has been processed, but due to elastic#93443
(and the executor's zero timeout) this sometimes doesn't work. This
commit fixes the problem by making every thread a core thread so that
they do not time out.

Closes elastic#92910
  • Loading branch information
DaveCTurner committed Feb 2, 2023
1 parent cf5ea0b commit 35a4420
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class PrioritizedThrottledTaskRunnerTests extends ESTestCase {
public void setUp() throws Exception {
super.setUp();
maxThreads = between(1, 10);
executor = EsExecutors.newScaling("test", 1, maxThreads, 0, TimeUnit.MILLISECONDS, false, threadFactory, threadContext);
executor = EsExecutors.newScaling("test", maxThreads, maxThreads, 0, TimeUnit.NANOSECONDS, false, threadFactory, threadContext);
}

@Override
Expand Down

0 comments on commit 35a4420

Please sign in to comment.