mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-07-05 00:56:58 +08:00
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");
|
||||
assertThat(buildCachePath).exists().isDirectory();
|
||||
assertThat(launchCachePath).exists().isDirectory();
|
||||
FileSystemUtils.deleteRecursively(buildCachePath);
|
||||
FileSystemUtils.deleteRecursively(launchCachePath);
|
||||
cleanupCache(buildCachePath);
|
||||
cleanupCache(launchCachePath);
|
||||
}
|
||||
|
||||
private static void cleanupCache(Path buildCachePath) {
|
||||
try {
|
||||
FileSystemUtils.deleteRecursively(buildCachePath);
|
||||
}
|
||||
catch (Exception ex) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
@TestTemplate
|
||||
|
@ -419,11 +419,20 @@ class BuildImageTests extends AbstractArchiveIntegrationTests {
|
||||
Path launchCachePath = Paths.get(tempDir, "junit-image-cache-" + testBuildId + "-launch");
|
||||
assertThat(buildCachePath).exists().isDirectory();
|
||||
assertThat(launchCachePath).exists().isDirectory();
|
||||
FileSystemUtils.deleteRecursively(buildCachePath);
|
||||
FileSystemUtils.deleteRecursively(launchCachePath);
|
||||
cleanupCache(buildCachePath);
|
||||
cleanupCache(launchCachePath);
|
||||
});
|
||||
}
|
||||
|
||||
private static void cleanupCache(Path buildCachePath) {
|
||||
try {
|
||||
FileSystemUtils.deleteRecursively(buildCachePath);
|
||||
}
|
||||
catch (Exception ex) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
@TestTemplate
|
||||
void whenBuildImageIsInvokedWithCreatedDate(MavenBuild mavenBuild) {
|
||||
String testBuildId = randomString();
|
||||
|
Loading…
Reference in New Issue
Block a user