Skip to content

Commit

Permalink
testcontainers#291 manual ping(2)
Browse files Browse the repository at this point in the history
  • Loading branch information
bsideup committed Feb 21, 2017
1 parent 71f15d7 commit 17c55c6
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,9 @@ static class NamedPipeProxy {
InetSocketAddress start() throws IOException {
ServerSocket listenSocket = new ServerSocket();
listenSocket.bind(new InetSocketAddress("localhost", 0));
log.debug("Listening on {} and proxying to {}", listenSocket.getLocalSocketAddress(), file);

executorService.submit(() -> {
log.debug("Listening on {} and proxying to {}", listenSocket.getLocalSocketAddress(), file);

try {
while (!Thread.interrupted()) {
try {
Expand Down Expand Up @@ -132,6 +131,8 @@ InetSocketAddress start() throws IOException {
} catch (IOException e) {
log.warn("", e);
}

log.info("Thread was interrupted. I'm done.");
}
} catch (Exception e) {
log.warn("", e);
Expand All @@ -142,6 +143,7 @@ InetSocketAddress start() throws IOException {
});
InetSocketAddress inetSocketAddress = (InetSocketAddress) listenSocket.getLocalSocketAddress();

log.info("Pinging...");
log.info("Ping: " + IOUtils.toString(URI.create("http://localhost:" + inetSocketAddress.getPort() + "/v1.25/_ping")));

return inetSocketAddress;
Expand Down

0 comments on commit 17c55c6

Please sign in to comment.