Skip to content

Commit 7faf418

Browse files
committed
Fixed tests
1 parent 2bc5bb5 commit 7faf418

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/operator/AsyncOperatorTests.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ protected Page createPage(int positionOffset, int length) {
112112
}
113113
};
114114
int maxConcurrentRequests = randomIntBetween(1, 10);
115-
AsyncOperator<Page> asyncOperator = new AsyncOperator<Page>(driverContext, maxConcurrentRequests) {
115+
AsyncOperator<Page> asyncOperator = new AsyncOperator<Page>(driverContext, threadPool.getThreadContext(), maxConcurrentRequests) {
116116
final LookupService lookupService = new LookupService(threadPool, globalBlockFactory, dict, maxConcurrentRequests);
117117

118118
@Override
@@ -175,7 +175,7 @@ class TestOp extends AsyncOperator<Page> {
175175
Map<Page, ActionListener<Page>> handlers = new HashMap<>();
176176

177177
TestOp(DriverContext driverContext, int maxOutstandingRequests) {
178-
super(driverContext, maxOutstandingRequests);
178+
super(driverContext, threadPool.getThreadContext(), maxOutstandingRequests);
179179
}
180180

181181
@Override
@@ -255,7 +255,7 @@ public void testFailure() throws Exception {
255255
);
256256
int maxConcurrentRequests = randomIntBetween(1, 10);
257257
AtomicBoolean failed = new AtomicBoolean();
258-
AsyncOperator<Page> asyncOperator = new AsyncOperator<Page>(driverContext, maxConcurrentRequests) {
258+
AsyncOperator<Page> asyncOperator = new AsyncOperator<Page>(driverContext, threadPool.getThreadContext(), maxConcurrentRequests) {
259259
@Override
260260
protected void performAsync(Page inputPage, ActionListener<Page> listener) {
261261
ActionRunnable<Page> command = new ActionRunnable<>(listener) {
@@ -317,7 +317,7 @@ public void testIsFinished() {
317317
for (int i = 0; i < iters; i++) {
318318
DriverContext driverContext = new DriverContext(blockFactory.bigArrays(), blockFactory);
319319
CyclicBarrier barrier = new CyclicBarrier(2);
320-
AsyncOperator<Page> asyncOperator = new AsyncOperator<Page>(driverContext, between(1, 10)) {
320+
AsyncOperator<Page> asyncOperator = new AsyncOperator<Page>(driverContext, threadPool.getThreadContext(), between(1, 10)) {
321321
@Override
322322
protected void performAsync(Page inputPage, ActionListener<Page> listener) {
323323
ActionRunnable<Page> command = new ActionRunnable<>(listener) {

x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/operator/DriverTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ static class SwitchContextOperator extends AsyncOperator<Page> {
376376
private final ThreadPool threadPool;
377377

378378
SwitchContextOperator(DriverContext driverContext, ThreadPool threadPool) {
379-
super(driverContext, between(1, 3));
379+
super(driverContext, threadPool.getThreadContext(), between(1, 3));
380380
this.threadPool = threadPool;
381381
}
382382

0 commit comments

Comments
 (0)