Skip to content

Commit af7807f

Browse files
fix(test): don't emit replay execution from TestRunnerUtils.awaitChildExecution
1 parent 9954b35 commit af7807f

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

core/src/test/java/io/kestra/core/runners/RestartCaseTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ public void replay() throws Exception {
152152
Execution finishedRestartedExecution = runnerUtils.awaitChildExecution(
153153
flow,
154154
firstExecution,
155-
restartedExec,
155+
restartedExec.withTenantId(MAIN_TENANT),
156156
Duration.ofSeconds(60)
157157
);
158158

@@ -318,7 +318,7 @@ public void restartOrReplayLoopUntil() throws Exception{
318318
Execution finalReplayedExecution = runnerUtils.awaitChildExecution(
319319
flow,
320320
firstExecution,
321-
replayedExecution,
321+
replayedExecution.withTenantId(MAIN_TENANT),
322322
Duration.ofSeconds(60)
323323
);
324324
assertThat(finalReplayedExecution.getState().getCurrent()).isEqualTo(Type.FAILED);

tests/src/main/java/io/kestra/core/runners/TestRunnerUtils.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -364,9 +364,8 @@ public Execution killExecution(Execution execution) throws QueueException {
364364
), execution);
365365
}
366366

367-
public Execution awaitChildExecution(Flow flow, Execution parentExecution, Execution execution, Duration duration)
368-
throws QueueException {
369-
return this.emitAndAwaitExecution(isTerminatedChildExecution(parentExecution, flow), execution, duration);
367+
public Execution awaitChildExecution(Flow flow, Execution parentExecution, Execution execution, Duration duration) {
368+
return this.awaitExecution(isTerminatedChildExecution(parentExecution, flow), execution, duration);
370369
}
371370

372371
private Predicate<Execution> isTerminatedExecution(Execution execution, Flow flow) {

webserver/src/test/java/io/kestra/webserver/controllers/api/ExecutionControllerRunnerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ void restartExecutionFromTaskIdWithSequential() throws Exception {
672672
runnerUtils.awaitChildExecution(
673673
flow.get(),
674674
parentExecution,
675-
createdChidExec,
675+
createdChidExec.withTenantId(TENANT_ID),
676676
Duration.ofSeconds(30));
677677
}
678678

0 commit comments

Comments
 (0)