From 9e1a25c3df69fb4e902171238c992f2077c3979d Mon Sep 17 00:00:00 2001 From: aldettinger Date: Fri, 17 Jun 2022 10:58:10 +0200 Subject: [PATCH] file: attempt atomic move to fix flakiness #3584 --- .../org/apache/camel/quarkus/component/file/it/FileTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/integration-tests/file/src/test/java/org/apache/camel/quarkus/component/file/it/FileTest.java b/integration-tests/file/src/test/java/org/apache/camel/quarkus/component/file/it/FileTest.java index 853660079e63..a28005535bc7 100644 --- a/integration-tests/file/src/test/java/org/apache/camel/quarkus/component/file/it/FileTest.java +++ b/integration-tests/file/src/test/java/org/apache/camel/quarkus/component/file/it/FileTest.java @@ -22,6 +22,7 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; +import java.nio.file.StandardCopyOption; import java.util.LinkedList; import java.util.List; import java.util.Map; @@ -131,7 +132,7 @@ public void idempotent() throws IOException { // move file back Path donePath = Paths.get(fileName01.replaceFirst("target/idempotent", "target/idempotent/done")); Path targetPath = Paths.get(fileName01); - Files.move(donePath, targetPath); + Files.move(donePath, targetPath, StandardCopyOption.ATOMIC_MOVE); // register file for deletion after tests pathsToDelete.add(targetPath);