Ignore exceptions when deleting caches in bind cache tests
See gh-40760
This commit is contained in:
parent
bdc6508b62
commit
d38c1e06b3
|
@ -317,8 +317,17 @@ class BootBuildImageIntegrationTests {
|
||||||
Path launchCachePath = Paths.get(tempDir, "junit-image-cache-" + projectName + "-launch");
|
Path launchCachePath = Paths.get(tempDir, "junit-image-cache-" + projectName + "-launch");
|
||||||
assertThat(buildCachePath).exists().isDirectory();
|
assertThat(buildCachePath).exists().isDirectory();
|
||||||
assertThat(launchCachePath).exists().isDirectory();
|
assertThat(launchCachePath).exists().isDirectory();
|
||||||
FileSystemUtils.deleteRecursively(buildCachePath);
|
cleanupCache(buildCachePath);
|
||||||
FileSystemUtils.deleteRecursively(launchCachePath);
|
cleanupCache(launchCachePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void cleanupCache(Path buildCachePath) {
|
||||||
|
try {
|
||||||
|
FileSystemUtils.deleteRecursively(buildCachePath);
|
||||||
|
}
|
||||||
|
catch (Exception ex) {
|
||||||
|
// ignore
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
|
|
|
@ -419,11 +419,20 @@ class BuildImageTests extends AbstractArchiveIntegrationTests {
|
||||||
Path launchCachePath = Paths.get(tempDir, "junit-image-cache-" + testBuildId + "-launch");
|
Path launchCachePath = Paths.get(tempDir, "junit-image-cache-" + testBuildId + "-launch");
|
||||||
assertThat(buildCachePath).exists().isDirectory();
|
assertThat(buildCachePath).exists().isDirectory();
|
||||||
assertThat(launchCachePath).exists().isDirectory();
|
assertThat(launchCachePath).exists().isDirectory();
|
||||||
FileSystemUtils.deleteRecursively(buildCachePath);
|
cleanupCache(buildCachePath);
|
||||||
FileSystemUtils.deleteRecursively(launchCachePath);
|
cleanupCache(launchCachePath);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void cleanupCache(Path buildCachePath) {
|
||||||
|
try {
|
||||||
|
FileSystemUtils.deleteRecursively(buildCachePath);
|
||||||
|
}
|
||||||
|
catch (Exception ex) {
|
||||||
|
// ignore
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@TestTemplate
|
@TestTemplate
|
||||||
void whenBuildImageIsInvokedWithCreatedDate(MavenBuild mavenBuild) {
|
void whenBuildImageIsInvokedWithCreatedDate(MavenBuild mavenBuild) {
|
||||||
String testBuildId = randomString();
|
String testBuildId = randomString();
|
||||||
|
|
Loading…
Reference in New Issue