Skip to content

Commit

Permalink
Cleanup after DockerTests suite completes (#54164) (#54646)
Browse files Browse the repository at this point in the history
Closes #54101. The Docker tests weren't cleanup up the created container
after the last test completed. Now they are.

Co-authored-by: Rory Hunter <pugnascotia@users.noreply.github.com>
  • Loading branch information
williamrandolph and pugnascotia committed Apr 2, 2020
1 parent fec9d5d commit afbd8e6
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.elasticsearch.packaging.util.ServerUtils;
import org.elasticsearch.packaging.util.Shell.Result;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;

Expand All @@ -46,6 +47,7 @@
import static org.elasticsearch.packaging.util.Docker.getImageLabels;
import static org.elasticsearch.packaging.util.Docker.getJson;
import static org.elasticsearch.packaging.util.Docker.mkDirWithPrivilegeEscalation;
import static org.elasticsearch.packaging.util.Docker.removeContainer;
import static org.elasticsearch.packaging.util.Docker.rmDirWithPrivilegeEscalation;
import static org.elasticsearch.packaging.util.Docker.runContainer;
import static org.elasticsearch.packaging.util.Docker.runContainerExpectingFailure;
Expand Down Expand Up @@ -83,6 +85,11 @@ public static void filterDistros() {
assumeTrue("only Docker", distribution().isDocker());
}

@AfterClass
public static void teardownSuite() {
removeContainer();
}

@Before
public void setupTest() throws IOException {
installation = runContainer(distribution());
Expand Down

0 comments on commit afbd8e6

Please sign in to comment.