Skip to content

The pack not working with Quarkus 3.16+ #276

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

Open
jedla97 opened this issue Mar 20, 2025 · 4 comments
Open

The pack not working with Quarkus 3.16+ #276

jedla97 opened this issue Mar 20, 2025 · 4 comments

Comments

@jedla97
Copy link

jedla97 commented Mar 20, 2025

Hi, I was revisiting our test disabled due to #191. This issue seems to be fixed for 3.15 (will comment there). But when running the test I encounter

TheConsumer - Generates message 'a message with a payload'  
Failures:

1) a message with a payload

    1.1) Exception while calling findClassLoaderOrder for nonapi.io.github.classgraph.classloaderhandler.QuarkusClassLoaderHandler


        at au.com.dius.pact.provider.junit5.PactVerificationContext.verifyInteraction(PactVerificationContext.kt:75)
        at io.quarkus.ts.http.pact.ProviderPactTest.testTemplate(ProviderPactTest.java:31)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at io.quarkus.test.junit.QuarkusTestExtension.runExtensionMethod(QuarkusTestExtension.java:960)
        at io.quarkus.test.junit.QuarkusTestExtension.runExtensionMethod(QuarkusTestExtension.java:890)
        at io.quarkus.test.junit.QuarkusTestExtension.interceptTestTemplateMethod(QuarkusTestExtension.java:850)
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
        at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
        at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
        at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762)
        at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:276)
        at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
        at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
        at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
        at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)

I tried to look at it more and found out that this happen with Quarkus 3.16+. The cause of this is change in quarkusio/quarkus#22673 which the classgraph/classgraph#891 fixed and relesed with classgraph version 4.8.178.
Unfortunetally the pact-jvm still depends on old classgraph (defined here) which is not compatible with Quarkus 3.16+.

I don't think it can be done much here, as it's depends on pact.

I tried replace the classgraph version here like this:

    <dependency>
      <groupId>io.github.classgraph</groupId>
      <artifactId>classgraph</artifactId>
      <version>4.8.179</version>
    </dependency>
    <dependency>
      <groupId>au.com.dius.pact.provider</groupId>
      <artifactId>junit5</artifactId>
      <version>${pact.version}</version>
      <exclusions>
        <exclusion>
          <groupId>io.github.classgraph</groupId>
          <artifactId>classgraph</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

and it was working (compiled using 3.16) but it's more like workaround and not the pernament solution.

You can check the the error using

  1. git clone [email protected]:quarkus-qe/quarkus-test-suite.git
  2. cd quarkus-test-suite
  3. Enable the ProviderPactTest test
  4. mvn clean test -f test-tooling/pact/
@rsvoboda
Copy link

I think you should file Quarkus issue and ping Holly there

@holly-cummins
Copy link
Contributor

holly-cummins commented Mar 20, 2025

Thanks for tracking it down to the specific PR! We have an ecosystem CI which runs the extension against the current version of Quarkus, so it seems like there may be some specific code path those tests aren't covering (probably messages with payloads, given #191 also wasn't spotted). I agree with @rsvoboda that it looks like it might need a Quarkus adjustment, or it might be that the right fix is just to take your workaround and put it into this extension. I should also look at what version of classgraph more recent Pact versions are using, just in case that fixes it for free.

@jedla97
Copy link
Author

jedla97 commented Mar 21, 2025

@rsvoboda @holly-cummins I was reading more about the issue and not find much reason why to create Quarkus issue.

In general the classgraph using reflection to get internal value. They update it after some discussion with Quarkus team on quarkusio/quarkus#44283 and classgraph/classgraph#891 (comment).

So I think this is only 3rd party dependency issue (pact) as they don't use updated version of classgraph. If you still think that the Quarkus issue should be created, please create it as I don't have much idea of what should be content of that issue.

I should also look at what version of classgraph more recent Pact versions are using, just in case that fixes it for free.

Latest 4.6.17 and 4.7.0 beta using 4.8.129 version. The main branch seems to be also using version 4.8.129. Looking at it it's version released at Oct 28 2021

@rsvoboda
Copy link

Thanks @jedla97 for the investigation

@holly-cummins can you talk to Pact people / create issue to bump classgraph?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants