valepakh commented on code in PR #4738:
URL: https://github.com/apache/ignite-3/pull/4738#discussion_r1846921084
##########
modules/compute/src/integrationTest/java/org/apache/ignite/internal/compute/ItComputeBaseTest.java:
##########
@@ -379,6 +389,168 @@ void
executeColocatedThrowsTableNotFoundExceptionWhenTableDoesNotExist() {
assertThat(ex.getCause().getMessage(), containsString("The table does
not exist [name=\"PUBLIC\".\"bad-table\"]"));
}
+ @ParameterizedTest(name = "local: {0}")
+ @ValueSource(booleans = {true, false})
+ void cancelComputeSubmitWithCancelHandle(boolean local) {
+ Ignite entryNode = node(0);
+ Ignite executeNode = local ? node(0) : node(1);
+
+ CancelHandle cancelHandle = CancelHandle.create();
+
+ JobExecutionOptions executionOptions =
JobExecutionOptions.builder().cancellationToken(cancelHandle.token()).build();
+
+ JobDescriptor<Long, Void> job =
JobDescriptor.builder(SilentSleepJob.class)
+ .options(executionOptions).units(units()).build();
+ JobExecution<Void> execution =
entryNode.compute().submit(JobTarget.node(clusterNode(executeNode)), job, 100L);
+
+ cancelHandle.cancel();
+
+ assertThat(execution.stateAsync(),
willBe(jobStateWithStatus(CANCELED)));
+ assertThat(execution.resultAsync(), willBe(nullValue()));
+
+ IgniteTestUtils.await(execution.cancelAsync());
+
+ assertThat(execution.cancelAsync(), willBe(false));
Review Comment:
The await is redundant, `willBe` matcher will wait for the future to
complete.
```suggestion
assertThat(execution.cancelAsync(), willBe(false));
```
--
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]