korlov42 commented on code in PR #7907:
URL: https://github.com/apache/ignite-3/pull/7907#discussion_r3015484453
##########
modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/api/ItSqlApiBaseTest.java:
##########
@@ -1278,23 +1286,56 @@ public void rowToString() {
@Test
public abstract void cancelBatch() throws InterruptedException;
- @Test
+ private static Stream<Arguments> rounds() {
+ return IntStream.range(0, 50).mapToObj(Arguments::of);
+ }
+
+ @ParameterizedTest
+ @MethodSource("rounds")
public void cancelDdlScript() {
IgniteSql sql = igniteSql();
+ String targetTable = "TEST2";
String script =
"CREATE TABLE test1 (id INT PRIMARY KEY);"
- + "CREATE TABLE test2 (id INT PRIMARY KEY);"
+ + "CREATE TABLE %s (id INT PRIMARY KEY);"
+ "CREATE TABLE test3 (id INT PRIMARY KEY);";
CancelHandle cancelHandle = CancelHandle.create();
CancellationToken token = cancelHandle.token();
- CompletableFuture<Void> scriptFut = IgniteTestUtils.runAsync(() ->
executeScript(sql, token, script));
Review Comment:
I would propose to simplify a bit:
- It should be safe to cancel `CancellationHandle` multiple times, no need
to introduce external guard (I refer to `AtomicBoolean cancelled`)
- cancel handle inside the `EventListener`; use `cancelAsync` to not block
meta storage thread
- in `EventListener`, use `trueCompletedFuture()` from if-block return; use
`falseCompletedFuture()` otherwise
- you don't use indices, and this test class doesn't shutdown nodes, so
`CLUSTER.nodes()` should be enough
- kinda nitpicking: Ignite 3 doesn't have requirement to use contradiction,
so full form is preferable (`ign` vs `ignite`)
- there is `@RepeatedTest()` annotation (which should be removed before
merge)
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]