question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

mockserver container times out occasionally on Apple M1

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
bsideupcommented, Feb 11, 2022

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 👍

1reaction
jakub-idcommented, Dec 30, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Mac m1 (apple silicon chip) and docker issues - Stack Overflow
I have tried using platform linux/amd64 or linux/x86_64. This seems to sometimes work, but the container start-up is much slower too. Please ...
Read more >
Running MockServer
Running MockServer. MockServer is flexible and support numerous usage patterns. MockServer can be run: programmatically via a Java API in an @Before or ......
Read more >
Advanced workflows - Mocking and testing - AWS Amplify Docs
Learn how to quickly test and debug without pushing all changes in your Amplify project to the cloud. Use local mocking and testing...
Read more >
mockserver/mockserver - Docker Image - Docker Hub
mockserver /mockserver. By mockserver • Updated 19 hours ago. MockServer enables easy mocking or proxying of any system you integrate with via HTTP...
Read more >
Change log for 4.10.43
Bug 2105304: Increase pod startup timeout in e2e tests #52 ... Bug 2038465: Upgrade chromedriver to 90.x to support Mac M1 chips #10691 ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found