You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The Gradle project consists of multiple RequestHandler which all need to be tested individually. We use one test profile for each handler test and one test class per handler.
The test profiles spawns test resources (WireMock, localstack) and sets the handler quarkus.lambda.handler accordingly with some other variables.
When running the tests we observe that the first @QuarkusTest class runs as expected but the subsequent class get stuck on the LambdaClient.invoke(...) call and blocks infinitely.
After some investigation it seems like the running AbstractLambdaPollLoop of the first QuarkusTest does not receive/check the interrupt of the Quarkus shutdown due to TestProfile switch.
Additionally the second QuarkusTest somehow does not wait until the old poll loop is destroyed and starts its poll loop and tests. The Lambda test call of the second QuarkusTest is queued into LambdaClient.REQUEST_QUEUE.
However, due to the fact that the first poll loop is still running, it requests another requestId in line AbstractLambdaPollLoop.java:60 which is then dequeued of the REQUEST_QUEUE by LambdaResourceManager.
Since the loop has been stopped, it exits and does not propagate the response to the CompletableFuture inside LambdaClient. The test call however of the second QuarkusTest is still waiting for the response.
Expected behavior
All tests run with their assigned profile without being blocking.
Actual behavior
A subsequent QuarkusTest blocks due to a not returning call inside AbstractLambdaPollLoop.
To Reproduce
We were not able to reproduce it in a small example project. However we hope that contributors of the lambda extension
with more in-depth knowledge of the Quarkus testing lifecycle will understand the above. If not we can only provide an example
of the testing setup based on the aws-lambda archetype project which somehow does not run in the stated problem.
Configuration
quarkus.lambda.enable-polling-jvm-mode=true
Screenshots
(If applicable, add screenshots to help explain your problem.)
Environment (please complete the following information):
Output of java -version:
openjdk 13.0.2 2020-01-14
OpenJDK Runtime Environment (build 13.0.2+8)
OpenJDK 64-Bit Server VM (build 13.0.2+8, mixed mode, sharing)
Quarkus version or git rev:
1.11.3.Final
Build tool (ie. output of mvnw --version or gradlew --version):
Gradle 6.5.1
Additional context
(Add any other context about the problem here.)
The text was updated successfully, but these errors were encountered:
It's possible that on shutdown the polling thread
could still have an active request. If this thread
gets a request from the queue it will break subsequent
test profile runs.
Fixesquarkusio#15195
Describe the bug
The Gradle project consists of multiple
RequestHandler
which all need to be tested individually. We use one test profile for each handler test and one test class per handler.The test profiles spawns test resources (WireMock, localstack) and sets the handler
quarkus.lambda.handler
accordingly with some other variables.When running the tests we observe that the first
@QuarkusTest
class runs as expected but the subsequent class get stuck on theLambdaClient.invoke(...)
call and blocks infinitely.After some investigation it seems like the running
AbstractLambdaPollLoop
of the first QuarkusTest does not receive/check the interrupt of the Quarkus shutdown due to TestProfile switch.Additionally the second QuarkusTest somehow does not wait until the old poll loop is destroyed and starts its poll loop and tests. The Lambda test call of the second QuarkusTest is queued into
LambdaClient.REQUEST_QUEUE
.However, due to the fact that the first poll loop is still running, it requests another requestId in line
AbstractLambdaPollLoop.java:60
which is then dequeued of the REQUEST_QUEUE byLambdaResourceManager
.Since the loop has been stopped, it exits and does not propagate the response to the
CompletableFuture
insideLambdaClient
. The test call however of the second QuarkusTest is still waiting for the response.Expected behavior
All tests run with their assigned profile without being blocking.
Actual behavior
A subsequent QuarkusTest blocks due to a not returning call inside
AbstractLambdaPollLoop
.To Reproduce
We were not able to reproduce it in a small example project. However we hope that contributors of the lambda extension
with more in-depth knowledge of the Quarkus testing lifecycle will understand the above. If not we can only provide an example
of the testing setup based on the aws-lambda archetype project which somehow does not run in the stated problem.
Configuration
quarkus.lambda.enable-polling-jvm-mode=true
Screenshots
(If applicable, add screenshots to help explain your problem.)
Environment (please complete the following information):
Output of
java -version
:openjdk 13.0.2 2020-01-14
OpenJDK Runtime Environment (build 13.0.2+8)
OpenJDK 64-Bit Server VM (build 13.0.2+8, mixed mode, sharing)
Quarkus version or git rev:
1.11.3.Final
mvnw --version
orgradlew --version
):Gradle 6.5.1
Additional context
(Add any other context about the problem here.)
The text was updated successfully, but these errors were encountered: