Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.

Commit

Permalink
8269403: Fix jpackage tests to gracefully handle jpackage app launche…
Browse files Browse the repository at this point in the history
…r crashes

Reviewed-by: almatvee, herrick
  • Loading branch information
Alexey Semenyuk committed Jun 28, 2021
1 parent 8d09596 commit efe8423
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -249,7 +249,9 @@ public Result executeAndRepeatUntilExitCode(int expectedCode, int max, int wait)

try {
Thread.sleep(wait * 1000);
} catch (Exception ex) {} // Ignore
} catch (InterruptedException ex) {
throw new RuntimeException(ex);
}

count++;
} while (count < max);
Expand Down
Expand Up @@ -399,8 +399,11 @@ public void executeAndVerifyOutput(String... args) {

public void executeAndVerifyOutput(boolean removePath,
List<String> launcherArgs, List<String> appArgs) {
getExecutor(launcherArgs.toArray(new String[0])).dumpOutput()
.setRemovePath(removePath).execute();
final int attempts = 3;
final int waitBetweenAttemptsSeconds = 5;
getExecutor(launcherArgs.toArray(new String[0])).dumpOutput().setRemovePath(
removePath).executeAndRepeatUntilExitCode(0, attempts,
waitBetweenAttemptsSeconds);
Path outputFile = TKit.workDir().resolve(OUTPUT_FILENAME);
verifyOutputFile(outputFile, appArgs, params);
}
Expand Down

1 comment on commit efe8423

@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.