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

The ImageMetricsITCase failing with RH Mandrel #37882

Closed
jedla97 opened this issue Dec 21, 2023 · 5 comments · Fixed by #37887
Closed

The ImageMetricsITCase failing with RH Mandrel #37882

jedla97 opened this issue Dec 21, 2023 · 5 comments · Fixed by #37887

Comments

@jedla97
Copy link
Contributor

jedla97 commented Dec 21, 2023

Describe the bug

The ImageMetricsITCase was introduced. But it's failing with RH mandrel (registry.access.redhat.com/quarkus/mandrel-23-rhel8:23.0) as it's bigger then then expected compared to the upstream (tried even older mandrel builds quay.io/quarkus/ubi-quarkus-mandrel-builder-image:23.0.2.1-Final-java17-2023-10-28 it passed without problem).

Expected behavior

No response

Actual behavior

Test is failing with this output:
Expected image_details.total_bytes to be within range [78626464 +- 3%] but was 81149928 ==> expected: <true> but was: <false>

How to Reproduce?

I using this command to verify
mvn -f integration-tests/pom.xml clean dependency:tree verify -Pnative -Dquarkus.native.container-build=true -Dquarkus.native.native-image-xmx=4g -U -V -B -fae -Denforcer.skip=true -Dtest-containers -Dstart-containers -Dquarkus.native.builder-image=registry.access.redhat.com/quarkus/mandrel-23-rhel8:23.0-16 -pl jpa-postgresql -Dpostgres.image=postgres:14

Output of uname -a or ver

Havving it on RHEL 8.9 and Fedora 39

Output of java -version

No response

Mandrel or GraalVM version (if different from Java)

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

Copy link

quarkus-bot bot commented Dec 21, 2023

/cc @Karm (mandrel), @ebullient (metrics), @galderz (mandrel), @jmartisk (metrics), @zakkak (mandrel)

@jedla97
Copy link
Contributor Author

jedla97 commented Dec 21, 2023

@zakkak As you add this new test can you look at it please. I know it can be skipped by export QUARKUS_NATIVE_IT_SKIP_VERIFY_IMAGE_METRICS=true but this would be also nice to have see the difference with RH build

@zakkak zakkak self-assigned this Dec 21, 2023
@zakkak
Copy link
Contributor

zakkak commented Dec 21, 2023

The differences I see between upstream and RH Mandrel are:

diff --git a/upstream-mandrel-image-metrics.properties b/rh-mandrel-image-metrics.properties
index dd835c7a730..60d8d3e6b9c 100644
--- a/upstream-mandrel-image-metrics.properties
+++ b/rh-mandrel-image-metrics.properties
@@ -1,11 +1,11 @@
 # Properties file used by ImageMetricsITCase
-image_details.total_bytes=79228920
+image_details.total_bytes=81162216
 image_details.total_bytes.tolerance=3
 analysis_results.types.reachable=19441
 analysis_results.types.reachable.tolerance=3
-analysis_results.methods.reachable=96417
+analysis_results.methods.reachable=96410
 analysis_results.methods.reachable.tolerance=3
-analysis_results.fields.reachable=27131
+analysis_results.fields.reachable=27129

which are bellow the 3% threshold.

The differences with the reference metrics stored in the Quarkus repository are:

diff --git a/integration-tests/jpa-postgresql/src/test/resources/image-metrics/23.0/image-metrics.properties b/rh-mandrel-image-metrics.properties
index 8dd4994f234..60d8d3e6b9c 100644
--- a/integration-tests/jpa-postgresql/src/test/resources/image-metrics/23.0/image-metrics.properties
+++ b/rh-mandrel-image-metrics.properties
@@ -1,21 +1,21 @@
 # Properties file used by ImageMetricsITCase
-image_details.total_bytes=78626464
+image_details.total_bytes=81162216
 image_details.total_bytes.tolerance=3
-analysis_results.types.reachable=19172
+analysis_results.types.reachable=19441
 analysis_results.types.reachable.tolerance=3
-analysis_results.methods.reachable=95204
+analysis_results.methods.reachable=96410
 analysis_results.methods.reachable.tolerance=3
-analysis_results.fields.reachable=27139
+analysis_results.fields.reachable=27129
 analysis_results.fields.reachable.tolerance=3
-analysis_results.types.reflection=5939
+analysis_results.types.reflection=6060
 analysis_results.types.reflection.tolerance=3
-analysis_results.methods.reflection=4401
+analysis_results.methods.reflection=4484

which are slightly above the 3% threshold.

For the time being I will just update the reference metrics in the test and later try to understand the differences between upstream and RH builds.

zakkak added a commit to zakkak/quarkus that referenced this issue Dec 21, 2023
Reference metrics where set using an older Mandrel 23.0 image, update
them using the latest Mandrel-23.0-based upstream builder image.

Closes quarkusio#37882
@quarkus-bot quarkus-bot bot added this to the 3.7 - main milestone Dec 21, 2023
@rsvoboda
Copy link
Member

later try to understand the differences between upstream and RH builds.

@zakkak Should we create issue for that follow-up?

@zakkak
Copy link
Contributor

zakkak commented Dec 21, 2023

@zakkak Should we create issue for that follow-up?

👍 graalvm/mandrel#654

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

Successfully merging a pull request may close this issue.

3 participants