From abb4800ab73c70ccb9090f21fd54b2a6860a69bf Mon Sep 17 00:00:00 2001 From: Matt Brown Date: Wed, 31 May 2017 21:12:32 -0400 Subject: [PATCH] fix MainIT to work on Docker for Mac need to add a healthcheck to the TemporaryJob to avoid helios-testing from thinking that the job is immediately available after the deploy finishes. see: https://github.com/spotify/dockerfile-maven/pull/13#issuecomment-305355177 https://github.com/spotify/helios/issues/916#issuecomment-221090878 --- .../src/test/java/com/spotify/it/frontend/MainIT.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plugin/src/it/advanced/frontend/src/test/java/com/spotify/it/frontend/MainIT.java b/plugin/src/it/advanced/frontend/src/test/java/com/spotify/it/frontend/MainIT.java index c1456626..34f52b86 100644 --- a/plugin/src/it/advanced/frontend/src/test/java/com/spotify/it/frontend/MainIT.java +++ b/plugin/src/it/advanced/frontend/src/test/java/com/spotify/it/frontend/MainIT.java @@ -26,6 +26,7 @@ import com.google.common.io.Resources; import com.google.common.net.HostAndPort; +import com.spotify.helios.common.descriptors.HealthCheck; import com.spotify.helios.testing.HeliosDeploymentResource; import com.spotify.helios.testing.HeliosSoloDeployment; import com.spotify.helios.testing.TemporaryJob; @@ -76,6 +77,11 @@ public void setUp() throws Exception { Resources.getResource("META-INF/docker/com.spotify.it/backend/image-name"), Charsets.UTF_8).trim()) .port("http", 1337) + .healthCheck(HealthCheck.newHttpHealthCheck() + .setPath("/api/version") + .setPort("http") + .build() + ) .deploy(); HostAndPort backendAddress = backendJob.address("http"); backend = httpUri(backendAddress); @@ -85,6 +91,11 @@ public void setUp() throws Exception { Charsets.UTF_8)) .command(backend.toString()) .port("http", 1338) + .healthCheck(HealthCheck.newHttpHealthCheck() + .setPath("/") + .setPort("http") + .build() + ) .deploy(); HostAndPort frontendAddress = frontendJob.address("http"); frontend = httpUri(frontendAddress);