Skip to content

Commit

Permalink
Merge pull request #6017 from gaol/WFCORE-6732
Browse files Browse the repository at this point in the history
[WFCORE-6732] WildFlyRunner doesn't call tearDown and completed ServerSetupTasks if a later one fails in setup
  • Loading branch information
yersan authored Jun 5, 2024
2 parents 21ff0a1 + 42826f6 commit ae21704
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 ae21704

Please sign in to comment.