Skip to content
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

Option to serialize ApplicationModel in quarkus:generate-code-tests for QuarkusTest runs #44966

Merged
merged 1 commit into from
Dec 6, 2024

Conversation

aloubyansky
Copy link
Member

@aloubyansky aloubyansky commented Dec 6, 2024

This is an optimization. With this change projects that have generate-code-tests goal configured will benefit from the application model resolved during this phase being serialized to a file and deserialized when bootstrapping tests. This has a couple of advantages:

  1. it saves time on the application model resolution (depending on the project ~80-95%), e.g. for super heroes rest-fights, it deserializes the model in ~110 ms compared to ~2066ms going through the resolver (after that the model would be serialized and the subsequent tests would load in ~35ms, so this whole change would be optimizing the first test run).
  2. It may happen that the resolver initialized in tests behaves somewhat differently from the original resolver used in mojos (due to issues in resolver initialization), so this change will help make sure the original Maven resolver was used to resolve the model.

A parameter called serializeTestModel was added to the quarkus:generate-code-test goal that can be used to disable test application model serialization to keep the previous behavior.

@quarkus-bot quarkus-bot bot added area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/maven labels Dec 6, 2024
…or QuarkusTests to re-use it instead of initializing the resolver and re-resolving the model.
@aloubyansky aloubyansky force-pushed the pass-serialized-model branch from 8931ff6 to 090e186 Compare December 6, 2024 12:03
Copy link

quarkus-bot bot commented Dec 6, 2024

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit 090e186.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

You can consult the Develocity build scans.


Flaky tests - Develocity

⚙️ JVM Tests - JDK 17

📦 integration-tests/grpc-hibernate

com.example.grpc.hibernate.BlockingRawTest.shouldAdd - History

  • Condition with Lambda expression in com.example.grpc.hibernate.BlockingRawTestBase was not fulfilled within 30 seconds. - org.awaitility.core.ConditionTimeoutException
org.awaitility.core.ConditionTimeoutException: Condition with Lambda expression in com.example.grpc.hibernate.BlockingRawTestBase was not fulfilled within 30 seconds.
	at org.awaitility.core.ConditionAwaiter.await(ConditionAwaiter.java:167)
	at org.awaitility.core.CallableCondition.await(CallableCondition.java:78)
	at org.awaitility.core.CallableCondition.await(CallableCondition.java:26)
	at org.awaitility.core.ConditionFactory.until(ConditionFactory.java:1006)
	at org.awaitility.core.ConditionFactory.until(ConditionFactory.java:975)
	at com.example.grpc.hibernate.BlockingRawTestBase.shouldAdd(BlockingRawTestBase.java:59)
	at java.base/java.lang.reflect.Method.invoke(Method.java:569)

⚙️ Native Tests - HTTP

📦 integration-tests/rest-client-reactive

io.quarkus.it.rest.client.BasicTestIT.shouldCreateClientSpans - History

  • expected: <1> but was: <2> - org.opentest4j.AssertionFailedError
org.opentest4j.AssertionFailedError: expected: <1> but was: <2>
	at io.quarkus.it.rest.client.BasicTest.shouldCreateClientSpans(BasicTest.java:216)
	at java.base/java.lang.reflect.Method.invoke(Method.java:569)
	at io.quarkus.test.junit.QuarkusTestExtension.interceptTestMethod(QuarkusTestExtension.java:789)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)

@aloubyansky aloubyansky merged commit 18110f8 into quarkusio:main Dec 6, 2024
52 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.18 - main milestone Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/maven triage/flaky-test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants