quarkiverse / quarkus-pact

Pact is a widely-recommended framework for consumer-driven contract testing. This Quarkus extension gives the best Pact integration with Quarkus.
https://pact.io/
Apache License 2.0
12 stars 6 forks source link

OutOfMemoryError running cross-extension integration tests with Quarkus 3.7 + #180

Open holly-cummins opened 7 months ago

holly-cummins commented 7 months ago

This is causing the current failures on https://github.com/quarkiverse/quarkiverse/issues/94, and it's also blocking any update to Quarkus 3.7.

2024-02-15 12:35:50,970 INFO  [io.qua.dep.dev.IsolatedDevModeMain] (main) Attempting to start live reload endpoint to recover from previous Quarkus startup failure
2024-02-15 12:35:51,199 ERROR [io.qua.dep.dev.IsolatedDevModeMain] (main) Failed to start quarkus: java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
        [error]: Build step io.quarkus.deployment.dev.testing.TestTracingProcessor#startTesting threw an exception: java.lang.OutOfMemoryError: Java heap space
        at java.base/java.lang.Object.clone(Native Method)
        at org.apache.maven.model.ModelBase.clone(ModelBase.java:218)
        at org.apache.maven.model.Profile.clone(Profile.java:60)
        at org.apache.maven.model.Model.clone(Model.java:356)
        at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:292)
        at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:243)
        at io.quarkus.bootstrap.resolver.maven.MavenModelBuilder.build(MavenModelBuilder.java:63)
        at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:284)
        at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:175)
        at org.eclipse.aether.internal.impl.collect.df.DfDependencyCollector.resolveCachedArtifactDescriptor(DfDependencyCollector.java:382)
        at org.eclipse.aether.internal.impl.collect.df.DfDependencyCollector.getArtifactDescriptorResult(DfDependencyCollector.java:368)
        at org.eclipse.aether.internal.impl.collect.df.DfDependencyCollector.processDependency(DfDependencyCollector.java:218)

The failure can be avoided by disabling the DevModeContractTestIT in the cross-extension project.

holly-cummins commented 7 months ago

Similar stack trace to https://github.com/quarkusio/quarkus/issues/32209, but that’s old, and fixed.

The tests are limited to running with 128m in RunAndCheckMojoBase.

It looks like this is a straw-that-broke-the-camels-back scenario, because with 3.6 I can get an OOM in the test by shrinking my heap to 110M.

I can reproduce, even with Quarkus 3.6, by running the app with mvn quarkus:dev -Djvm.args='-Xmx110m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/Users/holly'

Steps to reproduce

cd quarkus-pact/cross-extension-integration-tests/target/test-classes/projects/happy-everyone-all-together-processed
mvn quarkus:dev -Djvm.args=“-Xmx110m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=~”
holly-cummins commented 7 months ago

Here's the MAT Top Consumers view for 3.7:

image

holly-cummins commented 7 months ago

I've worked around this in the short term by increasing the heap given to the tests in https://github.com/quarkiverse/quarkus-pact/pull/177.

holly-cummins commented 7 months ago

I've raised https://github.com/quarkusio/quarkus/issues/38814 to track the issue on the Quarkus side.