xtern commented on code in PR #5688: URL: https://github.com/apache/ignite-3/pull/5688#discussion_r2065552975
########## modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/api/ItSqlAsynchronousApiTest.java: ########## @@ -178,6 +205,27 @@ private void executeAndCancel( assertThat(txManager().pending(), is(0)); } + private void executeBatchAndCancel(Function<CancellationToken, CompletableFuture<long[]>> execute) throws InterruptedException { + CancelHandle cancelHandle = CancelHandle.create(); + + // Run statement in another thread + CompletableFuture<long[]> f = execute.apply(cancelHandle.token()); + + waitUntilRunningQueriesCount(greaterThan(0)); + assertThat(f.isDone(), is(false)); + + cancelHandle.cancelAsync(); + + CompletionException err = assertThrows(CompletionException.class, f::join); + SqlException sqlErr = assertInstanceOf(SqlException.class, err.getCause()); + assertEquals(Sql.EXECUTION_CANCELLED_ERR, sqlErr.code()); + + cancelHandle.cancelAsync().join(); + + // Expect all transactions to be rollbacked Review Comment: ```suggestion // Expect all transactions to be rolled back ``` -- 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