Skip to content

Commit c0d1cf1

Browse files
committed
Fix test execution.
1 parent e8a2b0d commit c0d1cf1

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/inference/bulk/BulkInferenceExecutorTests.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import java.util.Iterator;
2828
import java.util.List;
2929
import java.util.concurrent.CountDownLatch;
30+
import java.util.concurrent.TimeUnit;
3031
import java.util.concurrent.atomic.AtomicReference;
3132

3233
import static org.hamcrest.Matchers.allOf;
@@ -141,7 +142,7 @@ public void testInferenceRunnerSometimesFails() throws Exception {
141142
assertThat(exception.get().getMessage(), equalTo("inference failure"));
142143
});
143144
}
144-
145+
145146
public void testParallelBulkExecution() throws Exception {
146147
int batches = between(50, 100);
147148
CountDownLatch latch = new CountDownLatch(batches);
@@ -168,7 +169,7 @@ public void testParallelBulkExecution() throws Exception {
168169
});
169170
}
170171

171-
latch.await();
172+
latch.await(10, TimeUnit.SECONDS);
172173
}
173174

174175
private BulkInferenceExecutor bulkExecutor(InferenceRunner inferenceRunner) {
@@ -225,11 +226,7 @@ private void runWithRandomDelay(Runnable runnable) {
225226
if (randomBoolean()) {
226227
runnable.run();
227228
} else {
228-
threadPool.schedule(
229-
runnable,
230-
TimeValue.timeValueNanos(between(1, 1_000)),
231-
threadPool.executor(EsqlPlugin.ESQL_WORKER_THREAD_POOL_NAME)
232-
);
229+
threadPool.schedule(runnable, TimeValue.timeValueNanos(between(1, 1_000)), threadPool.generic());
233230
}
234231
}
235232
}

0 commit comments

Comments
 (0)