Skip to content

Commit

Permalink
8320706: RuntimePackageTest.testUsrInstallDir test fails on Linux
Browse files Browse the repository at this point in the history
Reviewed-by: almatvee
  • Loading branch information
Alexey Semenyuk committed Nov 27, 2023
1 parent 1bb250c commit 726f854
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -888,10 +888,17 @@ private void assertFileInAppImage(Path filename, Path expectedPath) {
final Path rootDir = isImagePackageType() ? outputBundle() : pathToUnpackedPackageFile(
appInstallationDirectory());

try ( Stream<Path> walk = ThrowingSupplier.toSupplier(() -> Files.walk(
rootDir)).get()) {
List<String> files = walk.filter(path -> path.getFileName().equals(
filename)).map(Path::toString).toList();
try ( Stream<Path> walk = ThrowingSupplier.toSupplier(() -> {
if (TKit.isLinux() && rootDir.equals(Path.of("/"))) {
// Installed package with split app image on Linux. Iterate
// through package file list instead of the entire file system.
return LinuxHelper.getPackageFiles(this);
} else {
return Files.walk(rootDir);
}
}).get()) {
List<String> files = walk.filter(path -> filename.equals(
path.getFileName())).map(Path::toString).toList();

if (expectedPath == null) {
TKit.assertStringListEquals(List.of(), files, String.format(
Expand Down

1 comment on commit 726f854

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.