Skip to content

Commit

Permalink
Remove the attachee container if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
jerboaa committed Oct 2, 2024
1 parent 5b2f646 commit ef7abf2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/hotspot/jtreg/containers/docker/TestJcmdWithSideCar.java
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,13 @@ static class MainContainer {
};

public Process start(final boolean elevated) throws Exception {
// Be sure no main container with the same name already exists
OutputAnalyzer out = DockerTestUtils.execute(Container.ENGINE_COMMAND, "ps")
.shouldHaveExitValue(0);
if (out.contains(MAIN_CONTAINER_NAME)) {
DockerTestUtils.execute(Container.ENGINE_COMMAND, "rm", MAIN_CONTAINER_NAME)
.shouldHaveExitValue(0);
}
// start "main" container (the observee)
DockerRunOptions opts = commonDockerOpts("EventGeneratorLoop");

Expand Down

0 comments on commit ef7abf2

Please sign in to comment.