Skip to content
This repository was archived by the owner on Sep 26, 2023. It is now read-only.

ci: re-enable native image downstream check#1764

Merged
suztomo merged 2 commits intomainfrom
fix-native-downstream
Aug 4, 2022
Merged

ci: re-enable native image downstream check#1764
suztomo merged 2 commits intomainfrom
fix-native-downstream

Conversation

@mpeddada1
Copy link
Copy Markdown
Contributor

@mpeddada1 mpeddada1 commented Aug 2, 2022

The native image downstream checks are currently not running in gax (for example: https://github.com/googleapis/gax-java/runs/7621662093?check_suite_focus=true). This PR restores the original change from #1681 to address this.

Fixes #1686

@mpeddada1 mpeddada1 requested review from a team August 2, 2022 21:05
@mpeddada1
Copy link
Copy Markdown
Contributor Author

Hm the downstream check seems to be failing due to #1686. @suztomo did we get a chance to explore the root cause of this?

@suztomo
Copy link
Copy Markdown
Member

suztomo commented Aug 3, 2022

@mpeddada1
The root cause was that the enforcer rule runs first before GraalVM test. The result of the former is not interesting for GraalVM compatibility.

Are you disabling enforcer rule? Are you clear Which command in the shell scripts is failing?

@mpeddada1
Copy link
Copy Markdown
Contributor Author

Thank you! If it doesn't provide any information on graalvm compatibility then I might consider disabling it. Would this https://github.com/googleapis/java-orgpolicy/blob/b614e2d1360071801dcecc987da73f2e319a9b8d/.kokoro/build.sh#L74 be the place to make the change? I see that there's an option to do the following: -Denforcer.skip=true.

@suztomo
Copy link
Copy Markdown
Member

suztomo commented Aug 4, 2022

@mpeddada1 Yes, I see "INTEGRATION_TEST_ARGS" is the environment variable to set -Denforcer.skip=true.

@suztomo
Copy link
Copy Markdown
Member

suztomo commented Aug 4, 2022

Added the change.

@suztomo
Copy link
Copy Markdown
Member

suztomo commented Aug 4, 2022

"ci / maven unit tests" failed due to a seemingly-irrelevant test

Error:  Errors: 
Error:    BatcherImplTest.testThrottlingBlocking:895 Mockito 
No argument value was captured!
You might have forgotten to use argument.capture() in verify()...
...or you used capture() in stubbing but stubbed method was not called.
Be aware that it is recommended to use capture() only with verify()

Examples of correct argument capturing:
    ArgumentCaptor<Person> argument = ArgumentCaptor.forClass(Person.class);
    verify(mock).doSomething(argument.capture());
    assertEquals("John", argument.getValue().getName());

[INFO] 
Error:  Tests run: 525, Failures: 0, Errors: 1, Skipped: 0

@suztomo
Copy link
Copy Markdown
Member

suztomo commented Aug 4, 2022

"downstream / graalvm (22.1.0, 11, orgpolicy)" failed below.

com.google.api.gax.batching.BatcherImplTest > testThrottlingBlocking FAILED
    expected to be at least: 50
    but was                : 49
        at app//com.google.api.gax.batching.BatcherImplTest.testThrottlingBlocking(BatcherImplTest.java:896)

I restarted the failed job.

@suztomo
Copy link
Copy Markdown
Member

suztomo commented Aug 4, 2022

"Sonar / Java 11 Gradle Build" failed:

com.google.api.gax.batching.BatcherImplTest > testThrottlingBlocking FAILED
    org.mockito.exceptions.base.MockitoException: 
    No argument value was captured!
    You might have forgotten to use argument.capture() in verify()...
    ...or you used capture() in stubbing but stubbed method was not called.
    Be aware that it is recommended to use capture() only with verify()

    Examples of correct argument capturing:
        ArgumentCaptor<Person> argument = ArgumentCaptor.forClass(Person.class);
        verify(mock).doSomething(argument.capture());
        assertEquals("John", argument.getValue().getName());
        at app//com.google.api.gax.batching.BatcherImplTest.testThrottlingBlocking(BatcherImplTest.java:[895](https://github.com/googleapis/gax-java/runs/7674799653?check_suite_focus=true#step:6:896))

Gradle Test Executor 1 finished executing tests.

@suztomo
Copy link
Copy Markdown
Member

suztomo commented Aug 4, 2022

The test is flaky #1615

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Aug 4, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@mpeddada1
Copy link
Copy Markdown
Contributor Author

Nice!

@suztomo
Copy link
Copy Markdown
Member

suztomo commented Aug 4, 2022

It does run GraalVM tests.

https://github.com/googleapis/gax-java/runs/7675993133?check_suite_focus=true

========================================================================================================================
GraalVM Native Image: Generating 'native-tests' (executable)...
========================================================================================================================
[1/7] Initializing...                                                                                   (14.2s @ 0.33GB)
 Version info: 'GraalVM 22.1.0 Java 11 CE'
 C compiler: gcc (linux, x86_64, 9.4.0)
 Garbage collector: Serial GC
 6 user-provided feature(s)
  - com.google.api.gax.grpc.nativeimage.GrpcNettyFeature
  - com.google.api.gax.grpc.nativeimage.ProtobufMessageFeature
  - com.google.api.gax.nativeimage.GoogleJsonClientFeature
  - com.google.api.gax.nativeimage.OpenCensusFeature
  - com.oracle.svm.thirdparty.gson.GsonFeature
  - org.graalvm.junit.platform.JUnitPlatformFeature
[junit-platform-native] Running in 'test listener' mode using files matching pattern [junit-platform-unique-ids*] found in folder [/home/runner/work/gax-java/gax-java/java-shared-dependencies/java-orgpolicy/google-cloud-orgpolicy/target/test-ids] and its subfolders.
Warning: class initialization of class io.grpc.netty.shaded.io.netty.util.internal.logging.Slf4JLoggerFactory$NopInstanceHolder failed with exception java.lang.NoClassDefFoundError: Could not initialize class io.grpc.netty.shaded.io.netty.util.internal.logging.Slf4JLoggerFactory$NopInstanceHolder. This class will be initialized at run time. Use the option --initialize-at-run-time=io.grpc.netty.shaded.io.netty.util.internal.logging.Slf4JLoggerFactory$NopInstanceHolder to explicitly request delayed initialization of this class.
Warning: class initialization of class io.grpc.netty.shaded.io.netty.util.internal.logging.Log4JLogger failed with exception java.lang.NoClassDefFoundError: org/apache/log4j/Priority. This class will be initialized at run time. Use the option --initialize-at-run-time=io.grpc.netty.shaded.io.netty.util.internal.logging.Log4JLogger to explicitly request delayed initialization of this class.
[2/7] Performing analysis...  [*************]                                                          (290.1s @ 4.02GB)
  14,423 (92.12%) of 15,657 classes reachable
  28,578 (67.26%) of 42,487 fields reachable
 209,016 (84.03%) of 248,730 methods reachable
     469 classes,   952 fields, and 60,528 methods registered for reflection
      67 classes,    87 fields, and    55 methods registered for JNI access
[3/7] Building universe...                                                                              (85.8s @ 4.11GB)
GC warning: 65.4s spent in 5 GCs during the last stage, taking up 76.09% of the time.
            Please ensure more than 5.87GB of memory is available for Native Image
            to reduce GC overhead and improve image build time.
[4/7] Parsing methods...      [*******]                                                                 (47.7s @ 2.82GB)
GC warning: 32.7s spent in 6 GCs during the last stage, taking up 68.53% of the time.
            Please ensure more than 5.88GB of memory is available for Native Image
            to reduce GC overhead and improve image build time.
[5/7] Inlining methods...     [****]                                                                    (32.3s @ 3.00GB)
GC warning: 17.7s spent in 16 GCs during the last stage, taking up 53.83% of the time.
            Please ensure more than 5.89GB of memory is available for Native Image
            to reduce GC overhead and improve image build time.
[6/7] Compiling methods...    [*************]                                                          (185.7s @ 4.21GB)
[7/7] Creating image...                                                                                 (18.4s @ 3.33GB)
  60.92MB (38.99%) for code area:  138,723 compilation units
  71.44MB (45.73%) for image heap:   9,877 classes and 754,391 objects
  23.87MB (15.28%) for other data
 156.22MB in total
------------------------------------------------------------------------------------------------------------------------
Top 10 packages in code area:                               Top 10 object types in image heap:
  13.26MB com.oracle.svm.core.reflect                         18.17MB java.lang.reflect.Method
   2.58MB i.g.xds.shaded.io.envoyproxy.envoy.config.core.v3   13.09MB byte[] for code metadata
   2.55MB i.g.x.shaded.io.envoyproxy.envoy.config.route.v3     8.49MB byte[] for java.lang.String
   2.21MB com.google.protobuf                                  6.46MB byte[] for general heap data
   1.91MB i.g.xds.shaded.io.envoyproxy.envoy.api.v2.route      5.30MB java.lang.String
   1.86MB io.grpc.xds.shaded.io.envoyproxy.envoy.api.v2.core   4.33MB java.lang.Class
   1.60MB sun.security.ssl                                     1.95MB byte[] for reflection metadata
   1.49MB io.grpc.xds.shaded.io.envoyproxy.envoy.api.v2        1.81MB c.oracle.svm.core.reflect.SubstrateMethodAccessor
   1.36MB i.g.x.s.io.envoyproxy.envoy.config.cluster.v3        1.32MB java.lang.Class[]
   1.07MB com.google.re2j                                      1.32MB com.oracle.svm.core.hub.DynamicHubCompanion
      ... 388 additional packages                                 ... 2514 additional object types
                                           (use GraalVM Dashboard to see all)
------------------------------------------------------------------------------------------------------------------------
                      264.2s (37.8% of total time) in 167 GCs | Peak RSS: 5.97GB | CPU load: 1.89
------------------------------------------------------------------------------------------------------------------------
Produced artifacts:
 /home/runner/work/gax-java/gax-java/java-shared-dependencies/java-orgpolicy/google-cloud-orgpolicy/target/native-tests (executable)
 /home/runner/work/gax-java/gax-java/java-shared-dependencies/java-orgpolicy/google-cloud-orgpolicy/target/native-tests.build_artifacts.txt
========================================================================================================================
Finished generating 'native-tests' in 11m 37s.
[INFO] Executing: /home/runner/work/gax-java/gax-java/java-shared-dependencies/java-orgpolicy/google-cloud-orgpolicy/target/native-tests --xml-output-dir /home/runner/work/gax-java/gax-java/java-shared-dependencies/java-orgpolicy/google-cloud-orgpolicy/target/native-test-reports -Djunit.platform.listeners.uid.tracking.output.dir=/home/runner/work/gax-java/gax-java/java-shared-dependencies/java-orgpolicy/google-cloud-orgpolicy/target/test-ids
JUnit Platform on Native Image - report
----------------------------------------

com.google.cloud.orgpolicy.v2.OrgPolicyClientTest > updatePolicyExceptionTest SUCCESSFUL

com.google.cloud.orgpolicy.v2.OrgPolicyClientTest > deletePolicyTest2 SUCCESSFUL

com.google.cloud.orgpolicy.v2.OrgPolicyClientTest > getEffectivePolicyTest2 SUCCESSFUL

@suztomo suztomo merged commit 650a81c into main Aug 4, 2022
@suztomo suztomo deleted the fix-native-downstream branch August 4, 2022 17:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GraalVM downstream check failed upper-bound-deps

2 participants