-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Quarkus 3] Pact-Consumer-Test failing in XStream when injecting Pact Mockserver #34550
Comments
Hi @lostiniceland. Just stumbled upon this issue by accident, because we noticed the same problem in our project during our Quarkus 3 migration efforts :) For us, the error vanished after removing the injected |
@markusdlugi Thanks for sharing. I was hoping for some kind of workaround. I love your idea having Wiremock as a proxy because log-output of Pacts mockserver is a disaster |
Thanks for reporting, and for the reproducer, @lostiniceland. I think this is closely related to quarkiverse/quarkus-pact#73. Fixing this needs some changes to the pact extension, and also to core Quarkus, but no fixes can happen until some Quarkus dependencies are released. However, I notice that the Pact extensions are being added 'loose', rather than via the Pact extension. Pact extension is the recommended way of using Pact with Quarkus, rather than the raw libraries. So I'd suggested switching to the extension as a first action. I think things will still be broken, because of #73, but you'll be on the path where you'll get fixes. Here's a few extra pieces of context:
You might be able to work around the original xtream stack trace by either
|
@holly-cummins The approach in our wiremock / pact setup is, that we have a Quarkus test resource for Wiremock with a custom annotation, which makes it easy to inject Wiremock into tests etc. In a base test class, we do exactly that and provide a method, which accepts the MockServer and creates the proxy config for Wiremock using the MockServer url. Then we just need to call this method. In theory this setup can be achieved wherever the MockServer is available then. We will check if we can share something, without sharing internal information. |
@holly-cummins Thanks as well We also decided that moving to the pact-extension would be the best solution since we expected that in case there is some magic to be done it will happen there and not in pact itself. So we implemented the workaround with the extension by now. The demo was created without the extension because I was not sure how quarkiverse-extensions are treated within the Quarkus project with regards to issues and since both created the same result I placed the issue here rather than in the extension. |
@lostiniceland, do you mind editing the issue title to make it more clear the symptom is in Xstream and what exposes the issue is Also, I've just seen that JUnit 5.10-RC1 has dropped, so we're getting closer to getting that in. |
WireMock demo and workaround for the issue here: holly-cummins/pact-quarkus-sweater-demo#122 |
Describe the bug
Migrating from Quarkus 2 to 3 we encountered a blocking issue with Quarkus 3 in combination with Pact-Jvm.
All Consumer-Tests run into a Stackoverflow-Error when Pact is doing some serialization using XStream.
Please see attached demo-project, containing the same test in Quarkus 2 and 3. Running
mvn verify
will pass Quarkus 2 and fail 3.The only difference which might be interesting during investigation is that we had to add tons of
add-opens
directives to the surefire-plugin in the Quarkus 3 case, which wasnt necessary in 2. Since they run the same JVM and the same Pact version, this behaviour is quite odd.Also note that the surefire-plugin has to be configured not to use the System-Classloader according to the Pact-JVM documentation.
quarkus-pact-issue.tar.gz
Fun fact: running a Pact-Provider test works just fine.
Expected behavior
Test runs to completion
Actual behavior
Stackoverflow occurs
How to Reproduce?
Extract provided sample
Run
mvn verify
Output of
uname -a
orver
No response
Output of
java -version
17.0.1
GraalVM version (if different from Java)
No response
Quarkus version or git rev
3.2.0.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Maven 3.8.6
Additional information
There are already some issues involving Quarkus-Pact interop (see for example here) which seems to be why there is some working going on in the relatively new Quarkiverse-Pact-Extension. Unfortunately using this extension still doesnt solve the issue (the consumer-extension isnt currently doing much except providing the dependencies).
The Pact-JVM implementation is kinda strange and maybe the root lies there, but since the sample works in Quarkus 2 I've decided to place the issue here.
The text was updated successfully, but these errors were encountered: