From d12fbf05b01fdd04fd8a839fb0329336762ba67f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mathieu?= Date: Wed, 29 Jan 2025 15:41:47 +0100 Subject: [PATCH] fix(core): restartForEachItem() is flaky With this test change, running 100 tests with MySQL pass! --- .../io/kestra/plugin/core/flow/ForEachItemCaseTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/test/java/io/kestra/plugin/core/flow/ForEachItemCaseTest.java b/core/src/test/java/io/kestra/plugin/core/flow/ForEachItemCaseTest.java index 00bca794e3c..e51720049fb 100644 --- a/core/src/test/java/io/kestra/plugin/core/flow/ForEachItemCaseTest.java +++ b/core/src/test/java/io/kestra/plugin/core/flow/ForEachItemCaseTest.java @@ -276,7 +276,7 @@ public void forEachItemWithSubflowOutputs() throws TimeoutException, Interrupted } public void restartForEachItem() throws Exception { - CountDownLatch countDownLatch = new CountDownLatch(26); + CountDownLatch countDownLatch = new CountDownLatch(6); Flux receiveSubflows = TestsUtils.receive(executionQueue, either -> { Execution subflowExecution = either.getLeft(); if (subflowExecution.getFlowId().equals("restart-child") && subflowExecution.getState().getCurrent().isFailed()) { @@ -285,7 +285,7 @@ public void restartForEachItem() throws Exception { }); URI file = storageUpload(); - Map inputs = Map.of("file", file.toString(), "batch", 4); + Map inputs = Map.of("file", file.toString(), "batch", 20); Execution execution = runnerUtils.runOne(null, TEST_NAMESPACE, "restart-for-each-item", null, (flow, execution1) -> flowIO.readExecutionInputs(flow, execution1, inputs), Duration.ofSeconds(30)); @@ -296,7 +296,7 @@ public void restartForEachItem() throws Exception { assertTrue(countDownLatch.await(1, TimeUnit.MINUTES)); receiveSubflows.blockLast(); - CountDownLatch successLatch = new CountDownLatch(26); + CountDownLatch successLatch = new CountDownLatch(6); receiveSubflows = TestsUtils.receive(executionQueue, either -> { Execution subflowExecution = either.getLeft(); if (subflowExecution.getFlowId().equals("restart-child") && subflowExecution.getState().getCurrent().isSuccess()) {