Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WFARQ-16 ServerSetupObserver#handleAfterUndeploy() never tears down; … #86

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,7 @@ public synchronized void afterTestClass(@Observes AfterClass afterClass) throws
}
}
afterClassRun = true;
if (deployed.isEmpty()) {
deployed = null;
setupTasksAll.clear();
setupTasksInForce.clear();
afterClassRun = false;
}
this.clear();
}

public synchronized void handleAfterUndeploy(@Observes AfterUnDeploy afterDeploy, final Container container) throws Exception {
Expand All @@ -154,7 +149,7 @@ public synchronized void handleAfterUndeploy(@Observes AfterUnDeploy afterDeploy
}
int count = deployed.get(container.getName());
deployed.put(container.getName(), --count);
if (count == 0 && afterClassRun) {
if (count == 0 && !afterClassRun) {
for (int i = setupTasksInForce.size() - 1; i >= 0; i--) {
try {
setupTasksInForce.get(i).tearDown(managementClient.get(), container.getName());
Expand All @@ -165,16 +160,18 @@ public synchronized void handleAfterUndeploy(@Observes AfterUnDeploy afterDeploy
active.remove(container.getName());
deployed.remove(container.getName());
}
this.clear();
}

private void clear() {
if (deployed.isEmpty()) {
deployed = null;
setupTasksAll.clear();
setupTasksInForce.clear();
afterClassRun = false;
}

}


private static final class ContainerClassHolder {
private final Class<?> testClass;
private final String name;
Expand Down