mockserver container times out occasionally on Apple M1
It happens intermittently, likely because the container is amd64 and doesn't seem to be updated any more:
17:12:29 INFO GenericContainer Container mockserver/mockserver:mockserver-5.11.2 is starting: be0a77a7048804b3001bcf475b90c6dae58f46d8561b864c8433f4e7a70e0efc
17:12:29 INFO HttpWaitStrategy /keen_elbakyan: Waiting for 60 seconds for URL: http://localhost:53161/mockserver/status (where port 53161 maps to container port
1080)
17:13:29 ERROR GenericContainer Could not start container
org.testcontainers.containers.ContainerLaunchException: Timed out waiting for URL to be accessible (http://localhost:53161/mockserver/status should return HTTP [200])
at org.testcontainers.containers.wait.strategy.HttpWaitStrategy.waitUntilReady(HttpWaitStrategy.java:264) ~[testcontainers-1.16.2.jar:?]
at org.testcontainers.containers.wait.strategy.AbstractWaitStrategy.waitUntilReady(AbstractWaitStrategy.java:51) ~[testcontainers-1.16.2.jar:?]
at org.testcontainers.containers.GenericContainer.waitUntilContainerStarted(GenericContainer.java:929) ~[testcontainers-1.16.2.jar:?]
at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:468) ~[testcontainers-1.16.2.jar:?]
at org.testcontainers.containers.GenericContainer.lambda$doStart$0(GenericContainer.java:331) ~[testcontainers-1.16.2.jar:?]
at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:81) [duct-tape-1.0.8.jar:?]
at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:329) [testcontainers-1.16.2.jar:?]
at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:317) [testcontainers-1.16.2.jar:?]
at org.testcontainers.containers.GenericContainer.starting(GenericContainer.java:1066) [testcontainers-1.16.2.jar:?]
at org.testcontainers.containers.FailureDetectingExternalResource$1.evaluate(FailureDetectingExternalResource.java:29) [testcontainers-1.16.2.jar:?]
at org.testcontainers.containers.FailureDetectingExternalResource$1.evaluate(FailureDetectingExternalResource.java:30) [testcontainers-1.16.2.jar:?]
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) [junit-4.13.2.jar:4.13.2]
at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100) [junit-4.13.2.jar:4.13.2]
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366) [junit-4.13.2.jar:4.13.2]
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103) [junit-4.13.2.jar:4.13.2]
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63) [junit-4.13.2.jar:4.13.2]
at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331) [junit-4.13.2.jar:4.13.2]
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79) [junit-4.13.2.jar:4.13.2]
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329) [junit-4.13.2.jar:4.13.2]
at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66) [junit-4.13.2.jar:4.13.2]
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293) [junit-4.13.2.jar:4.13.2]
at org.testcontainers.containers.FailureDetectingExternalResource$1.evaluate(FailureDetectingExternalResource.java:30) [testcontainers-1.16.2.jar:?]
at org.junit.rules.RunRules.evaluate(RunRules.java:20) [junit-4.13.2.jar:4.13.2]
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) [junit-4.13.2.jar:4.13.2]
at org.junit.runners.ParentRunner.run(ParentRunner.java:413) [junit-4.13.2.jar:4.13.2]
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:365) [surefire-junit4-2.22.2.jar:2.22.2]
at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:273) [surefire-junit4-2.22.2.jar:2.22.2]
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238) [surefire-junit4-2.22.2.jar:2.22.2]
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:159) [surefire-junit4-2.22.2.jar:2.22.2]
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:384) [surefire-booter-2.22.2.jar:2.22.2]
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:345) [surefire-booter-2.22.2.jar:2.22.2]
at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:126) [surefire-booter-2.22.2.jar:2.22.2]
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:418) [surefire-booter-2.22.2.jar:2.22.2]
17:13:29 ERROR GenericContainer There are no stdout/stderr logs available for the failed container
same problem with me with apple macbook air m1 laptop
@skoczko Could you find any solution?
No. The failure is non-deterministic and related to the poor reliability of the QEMU emulation. I think the only solution is for the testcontainers to provide a native aarch64 container.
In my case, it is not working at all. Showing this error all the time.
I think the only solution is for the testcontainers to provide a native aarch64 container.
FYI the images are provided by the technologies, not us. See https://github.com/mock-server/mockserver/issues/819 and consider sharing your feedback there 👍
Same problem here with M1 Max
Also seeing this every time on an M1. Anyone seen any progress on this?
Unfortunately there isn't anything we can do on the Testcontainers side. It is the container images that are failing, and some x86 do not play well with QEMU.
What you can do is:
- Add " 👍 " here: https://github.com/mock-server/mockserver/issues/819
- Maybe report to Docker that QEMU layer crashes (you don't need Testcontainers to reproduce that)