Skip to content

Commit

Permalink
Use bash in InternalCommandPortListeningCheck since we depend on bash…
Browse files Browse the repository at this point in the history
…isms
  • Loading branch information
perlun committed Dec 18, 2019
1 parent e6f92c6 commit 02e189b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,14 @@ public Boolean call() {

Instant before = Instant.now();
try {
ExecResult result = ExecInContainerPattern.execInContainer(waitStrategyTarget.getContainerInfo(), "/bin/sh", "-c", command);
ExecResult result = ExecInContainerPattern.execInContainer(waitStrategyTarget.getContainerInfo(), "/bin/bash", "-c", command);
log.trace("Check for {} took {}", internalPorts, Duration.between(before, Instant.now()));

if (!result.getStderr().equals("")) {
log.warn("Internal port listening check emitted errors: " + result.getStderr());
return false;
}

return result.getExitCode() == 0;
} catch (Exception e) {
throw new IllegalStateException(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

public class InternalCommandPortListeningCheckTest {

// Linking a custom configuration into the container so that nginx is listening on port 8080. This is necessary to proof
// Linking a custom configuration into the container so that nginx is listening on port 8080. This is necessary to prove
// that the command formatting uses the correct casing for hexadecimal numberd (i.e. 1F90 and not 1f90).
@Rule
public GenericContainer nginx = new GenericContainer<>("nginx:1.9.4")
Expand Down

0 comments on commit 02e189b

Please sign in to comment.