This is an automated email from the ASF dual-hosted git repository. apupier pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit c475981809e4797a9456897a0585e7f9724dfac4 Author: Aurélien Pupier <[email protected]> AuthorDate: Tue Nov 17 09:07:44 2026 +0100 CAMEL-26818: camel-jbang-core - LoadTest: a work directory of its own, and wait for a status file that is being written Co-authored-by: IBM Bob 2.2.1 Signed-off-by: Aurélien Pupier <[email protected]> --- .../org/apache/camel/dsl/jbang/core/commands/LoadTest.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/LoadTest.java b/dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/LoadTest.java index fde604e4a30d..ede147fcb336 100644 --- a/dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/LoadTest.java +++ b/dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/LoadTest.java @@ -45,21 +45,19 @@ class LoadTest extends CamelCommandBaseTestSupport { private static final int PHASE_STARTED = 5; private File workingDir; - private Path previousHome; @BeforeEach @Override public void setup() throws Exception { super.setup(); + useTestWorkDir(); // the routes run in this JVM, and their CLI connector reads the actions in the user home - previousHome = CommandLineHelper.getHomeDir(); - CommandLineHelper.useHomeDir(HomeHelper.resolveHomeDir()); + useHomeDir(Path.of(HomeHelper.resolveHomeDir())); workingDir = Files.createTempDirectory("camel-load").toFile(); } @AfterEach public void end() throws IOException { - CommandLineHelper.useHomeDir(previousHome.toString()); FileUtil.removeDir(workingDir); } @@ -82,8 +80,9 @@ class LoadTest extends CamelCommandBaseTestSupport { AtomicReference<Exception> loadFailure = new AtomicReference<>(); Runnable r = () -> { try { - // wait until the integration has started: the status file is in the home dir - await().atMost(10, TimeUnit.SECONDS).until(LoadTest::integrationStarted); + // wait until the integration has started: the status file is in the home dir, and it is empty or + // incomplete while the integration writes it + await().atMost(10, TimeUnit.SECONDS).ignoreExceptions().until(LoadTest::integrationStarted); CamelLoadAction load = new CamelLoadAction(new CamelJBangMain()); CommandLineTestHelper.parse(load, getPid(), "--source=src/test/resources/load.yaml"); load.doCall();
