Skip to content

Commit 31e4aed

Browse files
authored
Debug ManyShardsIT (elastic#128127) (elastic#128138)
(cherry picked from commit 6052c5b)
1 parent 3e88802 commit 31e4aed

File tree

1 file changed

+9
-8
lines changed
  • x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action

1 file changed

+9
-8
lines changed

x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action/ManyShardsIT.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -110,26 +110,27 @@ public void testConcurrentQueries() throws Exception {
110110
CountDownLatch latch = new CountDownLatch(1);
111111
for (int q = 0; q < numQueries; q++) {
112112
threads[q] = new Thread(() -> {
113-
try {
114-
assertTrue(latch.await(1, TimeUnit.MINUTES));
115-
} catch (InterruptedException e) {
116-
throw new AssertionError(e);
117-
}
113+
safeAwait(latch);
118114
final var pragmas = Settings.builder();
119115
if (randomBoolean() && canUseQueryPragmas()) {
120116
pragmas.put(randomPragmas().getSettings())
121117
.put("task_concurrency", between(1, 2))
122118
.put("exchange_concurrent_clients", between(1, 2));
123119
}
124-
run("from test-* | stats count(user) by tags", new QueryPragmas(pragmas.build())).close();
125-
});
120+
try (var response = run("from test-* | stats count(user) by tags", new QueryPragmas(pragmas.build()))) {
121+
// do nothing
122+
} catch (Exception | AssertionError e) {
123+
logger.warn("Query failed with exception", e);
124+
throw e;
125+
}
126+
}, "testConcurrentQueries");
126127
}
127128
for (Thread thread : threads) {
128129
thread.start();
129130
}
130131
latch.countDown();
131132
for (Thread thread : threads) {
132-
thread.join();
133+
thread.join(10_000);
133134
}
134135
}
135136

0 commit comments

Comments
 (0)