From 53518ee9362563611d0fc337049e933cc77f63c9 Mon Sep 17 00:00:00 2001 From: Richard North Date: Fri, 24 Jan 2020 09:57:53 +0000 Subject: [PATCH] Fix CI Docker Compose test failure (#2284) ``` org.testcontainers.junit.DockerComposeContainerWithBuildTest > performTest[removeMode = ALL] FAILED java.lang.RuntimeException: java.lang.AssertionError: the pulled image is present after running: 'true' does not equal expected 'false' at org.rnorth.ducttape.timeouts.Timeouts.callFuture(Timeouts.java:68) at org.rnorth.ducttape.timeouts.Timeouts.getWithTimeout(Timeouts.java:43) at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:40) at org.testcontainers.junit.DockerComposeContainerWithBuildTest.performTest(DockerComposeContainerWithBuildTest.java:72) Caused by: java.lang.AssertionError: the pulled image is present after running: 'true' does not equal expected 'false' at org.rnorth.visibleassertions.VisibleAssertions.fail(VisibleAssertions.java:440) at org.rnorth.visibleassertions.VisibleAssertions.assertEquals(VisibleAssertions.java:174) at org.testcontainers.junit.DockerComposeContainerWithBuildTest.lambda$performTest$1(DockerComposeContainerWithBuildTest.java:74) ``` Hypothesis: docker-compose cannot remove the `redis` (latest) image because there is some other running container that relies on that image. This may be a CI-specific problem depending on the Azure Pipelines Docker setup. To work around (without publishing our own single-use image): use an old version of the Redis image that is unlikely to be in use by concurrent builds. --- core/src/test/resources/compose-build-test/Dockerfile | 2 +- core/src/test/resources/compose-build-test/docker-compose.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/test/resources/compose-build-test/Dockerfile b/core/src/test/resources/compose-build-test/Dockerfile index 521e2d23b80..f5df49b0152 100644 --- a/core/src/test/resources/compose-build-test/Dockerfile +++ b/core/src/test/resources/compose-build-test/Dockerfile @@ -1,3 +1,3 @@ -FROM redis +FROM redis:2.6.17 CMD ["redis-server"] diff --git a/core/src/test/resources/compose-build-test/docker-compose.yml b/core/src/test/resources/compose-build-test/docker-compose.yml index 333b2fa46f1..5b9f3e2c21b 100644 --- a/core/src/test/resources/compose-build-test/docker-compose.yml +++ b/core/src/test/resources/compose-build-test/docker-compose.yml @@ -3,4 +3,4 @@ services: customredis: build: . normalredis: - image: redis:latest + image: redis:2.6.17