Skip to content

Commit

Permalink
[WFCORE-6732] WildFlyRunner doesn't call tearDown and completed Serve…
Browse files Browse the repository at this point in the history
…rSetupTasks if a later one fails in setup
  • Loading branch information
gaol committed Jun 5, 2024
1 parent c8300b3 commit 42826f6
Showing 1 changed file with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,17 +184,34 @@ public void testRunFinished(Result result) throws Exception {
Security.insertProviderAt(ELYTRON_PROVIDER, 0);
providerInstalled = true;
}
RuntimeException setupException = null;
try {
if (automaticServerControl) {
runSetupTasks();
}
} catch (AssumptionViolatedException e) {
assumptionFailedInServerSetup = e;
} catch (RuntimeException e) {
setupException = e;
}
if (setupException == null) {
super.run(notifier);
}
super.run(notifier);

if (automaticServerControl) {
runTearDownTasks();
RuntimeException tearDownException = null;
try {
runTearDownTasks();
} catch (RuntimeException e) {
tearDownException = e;
} finally {
if (setupException != null) {
throw setupException;
}
if (tearDownException != null) {
throw tearDownException;
}
}
}
if (providerInstalled) {
Security.removeProvider(ELYTRON_PROVIDER.getName());
Expand Down

0 comments on commit 42826f6

Please sign in to comment.