Skip to content

Commit bdc7234

Browse files
committed
fix
1 parent dfd975e commit bdc7234

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

inferred-spans/src/test/java/io/opentelemetry/contrib/inferredspans/internal/SamplingProfilerTest.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,12 @@ void tearDown() {
5757
}
5858

5959
@Test
60-
void shouldLazilyCreateTempFilesAndCleanThem() throws Exception {
61-
62-
List<Path> tempFiles = getProfilerTempFiles();
63-
assertThat(tempFiles).isEmpty();
60+
void shouldLazilyCreateTempFilesAndCleanThem() {
61+
for (Path file : getProfilerTempFiles()) {
62+
if (!file.toFile().delete()) {
63+
throw new IllegalStateException("Could not delete temp file: " + file);
64+
}
65+
}
6466

6567
// temporary files should be created on-demand, and properly deleted afterwards
6668
setupProfiler(false);

0 commit comments

Comments
 (0)