quarkusio / quarkus-quickstarts

Quarkus quickstart code
https://quarkus.io
Apache License 2.0
1.96k stars 1.47k forks source link

SnsResourceTest failures: GH Actions #793

Open edtbl76 opened 3 years ago

edtbl76 commented 3 years ago

This appears intermittently:

It happens on the post() on either method. I've enabled this on my fork as well, and i'm seeing pass on my side/failure on yours, vice versa. I can't reproduce locally.

Error: Tests run: 4, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 51.708 s <<< FAILURE! - in org.acme.sns.SnsResourcesTest Error: org.acme.sns.SnsResourcesTest.testSubscriber(String)[2] Time elapsed: 30.027 s <<< ERROR! java.net.SocketTimeoutException: Read timed out at org.acme.sns.SnsResourcesTest.testSubscriber(SnsResourcesTest.java:39)

2021-02-28 18:58:34,632 INFO [io.quarkus] (main) Quarkus stopped in 0.025s [INFO] [INFO] Results: [INFO] Error: Errors: Error: SnsResourcesTest.testSubscriber:39 ? SocketTimeout Read timed out [INFO] Error: Tests run: 4, Failures: 0, Errors: 1, Skipped: 0

edtbl76 commented 3 years ago

I tracked down the problem locally.

There is an intermittent coms issue between the Java AWS SDK and Localstack. (There are a few threads on SO and GH).

Using the deprecated constructors allows you to use the deprecated port conventions, which is what the quickstarts are doing.

I can reproduce this (using any convention, new ports/old ports, new constructor/old constructor). -- Old Constructor --> LocalStackContainer("string" or empty).; -- new Constructor --> LocalStackContainer(DockerImageName.parse(String));

-- Old Ports --> Range of 45xx -> ?? , mapped to random external port -- New Ports --> 4566 for all services, mapped to random external port

If you don't operate in legacy mode, then the getEndpointOverride() method auto-magically returns localhost:4566, which is the convention you probably want to move to.

I've run about a dozen tests in each config, w/ roughly the same rate of failure. I can't reproduce it in debug, which narrows down some of the suspects.

It's "your circus, your monkeys"... I'm happy to fix the deprecations in favor of the newer formats w/ what appears to be the same level of flakiness or I can leave it alone and wait for a fix.

gsmet commented 3 years ago

/cc @marcinczeczko could you have a look?