quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.49k stars 2.59k forks source link

@QuarkusTest SocketTimeout on large responses #38502

Open tortru opened 6 months ago

tortru commented 6 months ago

Describe the bug

If AWS Lambda HTTP extension is enabled @QuarkusTest gets a SocketTimeout on large responses because the endpoints hangs. In my tests this happened for responses > 8190 bytes.

Expected behavior

test is working

Actual behavior

test times out

[ERROR] Errors: [ERROR] GreetingResourceTest.testHelloEndpoint:17 » SocketTimeout Read timed out

How to Reproduce?

steps to reproduce: go to code.quarkus.io select 3.6 enable RESTEasy Classic enable AWS Lambda HTTP generate and download the application run mvn test result is: BUILD SUCCESS replace "Hello RESTEasy" by "x".repeat(8191) in GreetingResource.java and GreetingResourceTest.java run again mvn test result is: [ERROR] GreetingResourceTest.testHelloEndpoint:17 » SocketTimeout Read timed out / BUILD FAILURE change the test string length from 8191 to 8190 test is working again

Output of uname -a or ver

5.15.133.1-microsoft-standard-WSL2 #1 SMP Thu Oct 5 21:02:42 UTC 2023 x86_64 GNU/Linux

Output of java -version

openjdk version "17.0.9" 2023-10-17

Quarkus version or git rev

3.6

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.9.6

Additional information

dev mode seems to have the same issue.

mvn quarkus:dev curl http://localhost:8080/hello curl hangs if content-length > 8190

geoand commented 6 months ago

Can you please attach a sample application that behaves the way you describe?

tortru commented 6 months ago

sure. attached you will find a sample application which shows this error when running mvn test. code-with-quarkus_new.zip

geoand commented 6 months ago

Thanks.

This only seems to happen when quarkus-amazon-lambda-http is being used, so this is one for @patriot1burke