[
https://issues.apache.org/jira/browse/IGNITE-23696?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Evgeny Stanilovsky updated IGNITE-23696:
----------------------------------------
Description:
Results of below test must not depend on execution node, but they depend:
place near test into ItComputeBaseTest:
{code:java}
@ParameterizedTest(name = "local: {0}")
@ValueSource(booleans = {true, false})
void cancelComputeSubmitWithCancelHandle(boolean local) {
Ignite entryNode = node(0);
Ignite executeNode = local ? node(0) : node(1);
JobDescriptor<Long, Void> job =
JobDescriptor.builder(SilentSleepJob.class).units(units()).build();
JobExecution<Void> execution =
entryNode.compute().submit(JobTarget.node(clusterNode(executeNode)), job, null);
IgniteTestUtils.await(execution.cancelAsync());
assertThat(execution.stateAsync(),
willBe(jobStateWithStatus(CANCELED)));
assertThat(execution.resultAsync(), willBe(nullValue()));
}
{code}
{code:java}
package org.apache.ignite.internal.compute;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CountDownLatch;
import org.apache.ignite.compute.ComputeJob;
import org.apache.ignite.compute.JobExecutionContext;
public class SilentSleepJob implements ComputeJob<Long, Void> {
@Override
public CompletableFuture<Void> executeAsync(JobExecutionContext
jobExecutionContext, Long timeout) {
try {
new CountDownLatch(1).await();
} catch (InterruptedException e) {
// no op.
}
return null;
}
}
{code}
I need to mention here one more case, if it different - fill free to move it
into different issue:
Simple execution flow is infinitely runs:
{code:java}
@Test
void cancelComputeSubmitMapReduce() {
Ignite entryNode = node(0);
for (int i = 0; i < 10; ++i) {
System.err.println("iteration: " + i);
TaskExecution<Void> execution = entryNode.compute()
.submitMapReduce(TaskDescriptor.builder(InfiniteMapReduceTask.class).units(units()).build(),
null);
execution.cancelAsync();
try {
execution.resultAsync().join();
} catch (Throwable th) {
// no op
}
}
}
{code}
was:
Results of below test must not depend on execution node, but they depend:
place near test into ItComputeBaseTest:
{code:java}
@ParameterizedTest(name = "local: {0}")
@ValueSource(booleans = {true, false})
void cancelComputeSubmitWithCancelHandle(boolean local) {
Ignite entryNode = node(0);
Ignite executeNode = local ? node(0) : node(1);
JobDescriptor<Long, Void> job =
JobDescriptor.builder(SilentSleepJob.class).units(units()).build();
JobExecution<Void> execution =
entryNode.compute().submit(JobTarget.node(clusterNode(executeNode)), job, null);
IgniteTestUtils.await(execution.cancelAsync());
assertThat(execution.stateAsync(),
willBe(jobStateWithStatus(CANCELED)));
assertThat(execution.resultAsync(), willBe(nullValue()));
}
{code}
{code:java}
package org.apache.ignite.internal.compute;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CountDownLatch;
import org.apache.ignite.compute.ComputeJob;
import org.apache.ignite.compute.JobExecutionContext;
public class SilentSleepJob implements ComputeJob<Long, Void> {
@Override
public CompletableFuture<Void> executeAsync(JobExecutionContext
jobExecutionContext, Long timeout) {
try {
new CountDownLatch(1).await();
} catch (InterruptedException e) {
// no op.
}
return null;
}
}
{code}
> Ignite compute, different return result for local and remote execution node
> ---------------------------------------------------------------------------
>
> Key: IGNITE-23696
> URL: https://issues.apache.org/jira/browse/IGNITE-23696
> Project: Ignite
> Issue Type: Bug
> Components: compute
> Affects Versions: 3.0.0-beta1
> Reporter: Evgeny Stanilovsky
> Assignee: Vadim Pakhnushev
> Priority: Major
> Labels: ignite-3
> Time Spent: 10m
> Remaining Estimate: 0h
>
> Results of below test must not depend on execution node, but they depend:
> place near test into ItComputeBaseTest:
> {code:java}
> @ParameterizedTest(name = "local: {0}")
> @ValueSource(booleans = {true, false})
> void cancelComputeSubmitWithCancelHandle(boolean local) {
> Ignite entryNode = node(0);
> Ignite executeNode = local ? node(0) : node(1);
> JobDescriptor<Long, Void> job =
> JobDescriptor.builder(SilentSleepJob.class).units(units()).build();
> JobExecution<Void> execution =
> entryNode.compute().submit(JobTarget.node(clusterNode(executeNode)), job,
> null);
> IgniteTestUtils.await(execution.cancelAsync());
> assertThat(execution.stateAsync(),
> willBe(jobStateWithStatus(CANCELED)));
> assertThat(execution.resultAsync(), willBe(nullValue()));
> }
> {code}
> {code:java}
> package org.apache.ignite.internal.compute;
> import java.util.concurrent.CompletableFuture;
> import java.util.concurrent.CountDownLatch;
> import org.apache.ignite.compute.ComputeJob;
> import org.apache.ignite.compute.JobExecutionContext;
> public class SilentSleepJob implements ComputeJob<Long, Void> {
> @Override
> public CompletableFuture<Void> executeAsync(JobExecutionContext
> jobExecutionContext, Long timeout) {
> try {
> new CountDownLatch(1).await();
> } catch (InterruptedException e) {
> // no op.
> }
> return null;
> }
> }
> {code}
> I need to mention here one more case, if it different - fill free to move it
> into different issue:
> Simple execution flow is infinitely runs:
> {code:java}
> @Test
> void cancelComputeSubmitMapReduce() {
> Ignite entryNode = node(0);
> for (int i = 0; i < 10; ++i) {
> System.err.println("iteration: " + i);
> TaskExecution<Void> execution = entryNode.compute()
>
> .submitMapReduce(TaskDescriptor.builder(InfiniteMapReduceTask.class).units(units()).build(),
> null);
> execution.cancelAsync();
> try {
> execution.resultAsync().join();
> } catch (Throwable th) {
> // no op
> }
> }
> }
> {code}
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)