Skip to content

Commit

Permalink
fix(core): always close the queue after receive
Browse files Browse the repository at this point in the history
May improve test flakyness
  • Loading branch information
loicmathieu committed Jan 14, 2025
1 parent 0c0ff37 commit f217d33
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions core/src/main/java/io/kestra/core/runners/RunnerUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,18 @@ public Execution awaitExecution(Predicate<Execution> predicate, Runnable executi
}
}, false);

executionEmitter.run();
try {
executionEmitter.run();

if (duration == null) {
Await.until(() -> receive.get() != null, Duration.ofMillis(10));
} else {
Await.until(() -> receive.get() != null, Duration.ofMillis(10), duration);
if (duration == null) {
Await.until(() -> receive.get() != null, Duration.ofMillis(10));
} else {
Await.until(() -> receive.get() != null, Duration.ofMillis(10), duration);
}
} finally {
cancel.run();
}

cancel.run();

return receive.get();
}
Expand Down

0 comments on commit f217d33

Please sign in to comment.