xtern commented on code in PR #2925: URL: https://github.com/apache/ignite-3/pull/2925#discussion_r1422059232
########## modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/exec/ExecutionServiceImplTest.java: ########## @@ -699,6 +702,88 @@ public void testErrorIsPropagatedToPrefetchCallback() { cursor.closeAsync(); } + /** + * Test checks the format of the debugging information dump obtained during query execution. + * To obtain verifiable results, all response messages are blocked while debugging information is obtained. + */ + @Test + public void testDebugInfoFormat() throws InterruptedException { + ExecutionServiceImpl<?> execService = executionServices.get(0); + BaseQueryContext ctx = createContext(); + QueryPlan plan = prepare("SELECT * FROM test_tbl", ctx); + + CountDownLatch startResponseLatch = new CountDownLatch(4); + CountDownLatch continueLatch = new CountDownLatch(1); + + nodeNames.stream().map(testCluster::node).forEach(node -> node.interceptor((senderNodeName, msg, original) -> { + if (msg instanceof QueryStartResponseImpl) { + startResponseLatch.countDown(); + + ForkJoinPool.commonPool().execute(() -> { + try { + continueLatch.await(TIMEOUT_IN_MS, TimeUnit.MILLISECONDS); + } catch (InterruptedException ignore) { + // No-op. + } + + original.onMessage(senderNodeName, msg); + }); + + return nullCompletedFuture(); + } else { + original.onMessage(senderNodeName, msg); + + return nullCompletedFuture(); + } + })); + + InternalTransaction tx = new NoOpTransaction(nodeNames.get(0)); + AsyncCursor<InternalSqlRow> cursor = execService.executePlan(tx, plan, ctx); + + startResponseLatch.await(TIMEOUT_IN_MS, TimeUnit.MILLISECONDS); + + String debugInfoCoordinator = executionServices.get(0).dumpDebugInfo(); + String debugInfo2 = executionServices.get(1).dumpDebugInfo(); + String debugInfo3 = executionServices.get(2).dumpDebugInfo(); + + continueLatch.countDown(); + + await(cursor.closeAsync()); + + assertTrue(waitForCondition( + () -> executionServices.stream().map(es -> es.localFragments(ctx.queryId()).size()) + .mapToInt(i -> i).sum() == 0, TIMEOUT_IN_MS)); + + String nl = System.lineSeparator(); + + String expectedOnCoordinator = format(nl Review Comment: Added threads dumping. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@ignite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org