Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public void testConcurrentQueries() throws Exception {
logger.warn("Query failed with exception", e);
throw e;
}
}, "testConcurrentQueries");
}, "testConcurrentQueries-" + q);
}
for (Thread thread : threads) {
thread.start();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,10 @@

import java.util.Collection;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.LongAdder;

import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
import static org.elasticsearch.xpack.esql.EsqlTestUtils.as;
import static org.elasticsearch.xpack.esql.EsqlTestUtils.getValuesList;
import static org.hamcrest.Matchers.greaterThan;
import static org.hamcrest.Matchers.hasSize;

public class DataNodeRequestSenderIT extends AbstractEsqlIntegTestCase {
Expand All @@ -52,17 +50,19 @@ public void testSearchWhileRelocating() throws InterruptedException {

// start background searches
var stopped = new AtomicBoolean(false);
var queries = new LongAdder();
var threads = new Thread[randomIntBetween(1, 5)];
for (int i = 0; i < threads.length; i++) {
threads[i] = new Thread(() -> {
while (stopped.get() == false) {
try (EsqlQueryResponse resp = run("FROM index-1")) {
assertThat(getValuesList(resp), hasSize(docs));
} catch (Exception | AssertionError e) {
logger.warn("Query failed with exception", e);
stopped.set(true);
throw e;
}
queries.increment();
}
});
}, "testSearchWhileRelocating-" + i);
}
for (Thread thread : threads) {
thread.start();
Expand Down Expand Up @@ -93,7 +93,6 @@ public void testSearchWhileRelocating() throws InterruptedException {
.prepareUpdateSettings(TEST_REQUEST_TIMEOUT, TEST_REQUEST_TIMEOUT)
.setPersistentSettings(Settings.builder().putNull("cluster.routing.allocation.exclude._name"))
.get();
assertThat(queries.sum(), greaterThan((long) threads.length));
}

public void testRetryOnShardMovement() {
Expand Down