Skip to content

Commit

Permalink
Merge pull request quarkusio#26933 from geoand/quarkusio#26882
Browse files Browse the repository at this point in the history
Fix test resource close issues in command mode tests
  • Loading branch information
gsmet authored Jul 26, 2022
2 parents 872fda2 + 29fe54c commit 06e5acd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,12 @@ private ArtifactLauncher.LaunchResult doProcessStart(ExtensionContext context, S
System.setProperty(i.getKey(), i.getValue());
}
}
if (testResourceManager != null) {
testResourceManager.close();
try {
if (testResourceManager != null) {
testResourceManager.close();
}
} catch (Exception e) {
System.err.println("Unable to shutdown resource: " + e.getMessage());
}
}
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,16 +214,16 @@ private int doJavaStart(ExtensionContext context, Class<? extends QuarkusTestPro
if (!InitialConfigurator.DELAYED_HANDLER.isActivated()) {
activateLogging();
}

throw e;
} finally {
try {
if (testResourceManager != null) {
testResourceManager.close();
}
} catch (Exception ex) {
e.addSuppressed(ex);
} catch (Exception e) {
System.err.println("Unable to shutdown resource: " + e.getMessage());
}
throw e;
} finally {

uninstallLoggerRedirect();
QuarkusConsole.uninstallRedirects();
if (originalCl != null) {
Expand Down

0 comments on commit 06e5acd

Please sign in to comment.