Skip to content

Commit 52d5cc2

Browse files
committed
Make TempLocationManagerTest less flaky
1 parent 34782b6 commit 52d5cc2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dd-java-agent/agent-profiling/profiling-controller/src/test/java/com/datadog/profiling/controller/TempLocationManagerTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,10 @@ void testCleanup(String subPath) throws Exception {
112112
Path tmpFile = Files.createFile(fakeTempDir.resolve("test.txt"));
113113
tmpFile.toFile().deleteOnExit(); // make sure this is deleted at exit
114114
fakeTempDir.toFile().deleteOnExit(); // also this one
115-
tempLocationManager.cleanup(false);
115+
boolean rslt = tempLocationManager.cleanup(false);
116116
// fake temp location should be deleted
117117
// real temp location should be kept
118-
assertFalse(Files.exists(fakeTempDir));
118+
assertFalse(rslt && Files.exists(fakeTempDir));
119119
assertTrue(Files.exists(tempDir));
120120
}
121121

0 commit comments

Comments
 (0)