Skip to content

Commit 6052c5b

Browse files
authored
Debug ManyShardsIT (#128127)
1 parent 9de75e6 commit 6052c5b

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
@@ -109,26 +109,27 @@ public void testConcurrentQueries() throws Exception {
109109
CountDownLatch latch = new CountDownLatch(1);
110110
for (int q = 0; q < numQueries; q++) {
111111
threads[q] = new Thread(() -> {
112-
try {
113-
assertTrue(latch.await(1, TimeUnit.MINUTES));
114-
} catch (InterruptedException e) {
115-
throw new AssertionError(e);
116-
}
112+
safeAwait(latch);
117113
final var pragmas = Settings.builder();
118114
if (randomBoolean() && canUseQueryPragmas()) {
119115
pragmas.put(randomPragmas().getSettings())
120116
.put("task_concurrency", between(1, 2))
121117
.put("exchange_concurrent_clients", between(1, 2));
122118
}
123-
run("from test-* | stats count(user) by tags", new QueryPragmas(pragmas.build())).close();
124-
});
119+
try (var response = run("from test-* | stats count(user) by tags", new QueryPragmas(pragmas.build()))) {
120+
// do nothing
121+
} catch (Exception | AssertionError e) {
122+
logger.warn("Query failed with exception", e);
123+
throw e;
124+
}
125+
}, "testConcurrentQueries");
125126
}
126127
for (Thread thread : threads) {
127128
thread.start();
128129
}
129130
latch.countDown();
130131
for (Thread thread : threads) {
131-
thread.join();
132+
thread.join(10_000);
132133
}
133134
}
134135

0 commit comments

Comments
 (0)