-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WIP] docker compose refactoring, to support scaling, better output l…
- Loading branch information
Showing
16 changed files
with
410 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...c/main/java/org/testcontainers/containers/startupcheck/IsRunningStartupCheckStrategy.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package org.testcontainers.containers.startupcheck; | ||
|
||
import com.github.dockerjava.api.DockerClient; | ||
import com.github.dockerjava.api.command.InspectContainerResponse; | ||
import org.testcontainers.utility.DockerStatus; | ||
|
||
/** | ||
* Simplest possible implementation of {@link StartupCheckStrategy} - just check that the container | ||
* has reached the running state and has not exited. | ||
*/ | ||
public class IsRunningStartupCheckStrategy extends StartupCheckStrategy { | ||
|
||
@Override | ||
public StartupStatus checkStartupState(DockerClient dockerClient, String containerId) { | ||
InspectContainerResponse.ContainerState state = getCurrentState(dockerClient, containerId); | ||
if (state.getRunning()) { | ||
return StartupStatus.SUCCESSFUL; | ||
} else if (!DockerStatus.isContainerExitCodeSuccess(state)) { | ||
return StartupStatus.FAILED; | ||
} else { | ||
return StartupStatus.NOT_YET_KNOWN; | ||
} | ||
} | ||
} |
Oops, something went wrong.