Repository navigation
Conversation
|
|
https://source.cloud.google.com/results/invocations/8c0474b8-e199-4faf-b2a4-683ef232f65f/targets/cloud-devrel%2Fclient-libraries%2Fjava%2Fjava-compute%2Fpresubmit%2Fgraalvm-native/log this seems true positive: Retrying. |
RegionInstanceGroupManagersClientTest is not part of the tests this time. Why?
Retrying. It turned out that when it got "Zone us-central1-a was not found in zones list" error, it failed at When it got |
find . -name '*.class' |grep -v '$1' |grep -v OrBuilder \ |perl -nle 'print "computeClassesBuilder.add(\"com.google.cloud.compute.v1.$1\");" if m|v1\/(.+?).class|' \ |sort -u
|
"Kokoro - Test: Java GraalVM Native Image" succeeded. It took 1 hr 30 min. |
|
All checks have passed |
| "com.google.cloud.compute.v1.TestIamPermissionsLicenseCodeRequest$Builder"); | ||
| computeClassesBuilder.add("com.google.cloud.compute.v1.TestIamPermissionsLicenseRequest"); | ||
| computeClassesBuilder.add( | ||
| "com.google.cloud.compute.v1.TestIamPermissionsLicenseRequest$Builder"); | ||
| computeC |
There was a problem hiding this comment.
Out of curiosity, what happens when we remove these lines?
There was a problem hiding this comment.
You get the errors such as:
Suppressed: java.lang.ExceptionInInitializerError
com.google.cloud.compute.v1.Compute.<clinit>(Compute.java:18809)
com.google.cloud.compute.v1.Operation.getDescriptor(Operation.java:291)
com.google.cloud.compute.v1.stub.HttpJsonRegionInstanceGroupManagersStub.<clinit>(HttpJsonRegionInstanceGroupManagersStub.java:84)
com.google.cloud.compute.v1.RegionInstanceGroupManagersClientTest.startStaticServer(RegionInstanceGroupManagersClientTest.java:58)
java.lang.reflect.Method.invoke(Method.java:566)
[...]
Caused by: java.lang.RuntimeException: Generated message class "com.google.api.FieldBehavior" missing method "valueOf".
com.google.protobuf.GeneratedMessage.getMethodOrDie(GeneratedMessage.java:1973)
com.google.protobuf.GeneratedMessage.access$1100(GeneratedMessage.java:61)
com.google.protobuf.GeneratedMessage$GeneratedExtension.<init>(GeneratedMessage.java:1789)
com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension(GeneratedMessage.java:1643)
com.google.api.FieldBehaviorProto.<clinit>(FieldBehaviorProto.java:55)
[...]
Caused by: java.lang.NoSuchMethodException: com.google.api.FieldBehavior.valueOf(com.google.protobuf.Descriptors$EnumValueDescriptor)
java.lang.Class.getMethod(DynamicHub.java:1114)
com.google.protobuf.GeneratedMessage.getMethodOrDie(GeneratedMessage.java:1970)
[...]
| "com.google.cloud.compute.v1.TestIamPermissionsLicenseRequest$Builder"); | ||
| computeC |
There was a problem hiding this comment.
We can probably shorten this and similar classes above by making using of registerClassHierarchyForReflection("com.google.cloud.compute.v1.XpnHostList") which will register nested non-private classes.
There was a problem hiding this comment.
With that approach, we need to exclude the inner classes. It's an additional step in listing classes. I think it's easier to maintain the class list if we just register all classes regardless of nested or not.
What do you think?
| computeClassesBuilder.add( | ||
| "com.google.cloud.compute.v1.AbandonInstancesRegionInstanceGroupManagerRequest"); | ||
| computeClassesBuilder.add( | ||
| "com.google.cloud.compute.v1.AbandonInstancesRegionInstanceGroupManagerRequest$Builder"); |
There was a problem hiding this comment.
Could you point me to the tests that fail if we don't include these com.google.cloud.compute.v1 classes? I've experienced situations where I had to add a ton a classes for reflection to make the test work but it was just one class that was needed in the end, so I'm secretly hoping that we'll run into same scenario here.
There was a problem hiding this comment.
Here is an example:
JUnit Vintage:NetworkFirewallPoliciesClientTest:getTest
MethodSource [className = 'com.google.cloud.compute.v1.NetworkFirewallPoliciesClientTest', methodName = 'getTest', methodParameterTypes = '']
=> com.google.api.gax.rpc.UnknownException: java.lang.RuntimeException: Generated message class "com.google.cloud.compute.v1.FirewallPolicy" missing method "getAssociationsList".
com.google.api.gax.rpc.ApiExceptionFactory.createException(ApiExceptionFactory.java:119)
com.google.api.gax.rpc.ApiExceptionFactory.createException(ApiExceptionFactory.java:41)
com.google.api.gax.httpjson.HttpJsonApiExceptionFactory.create(HttpJsonApiExceptionFactory.java:67)
com.google.api.gax.httpjson.HttpJsonExceptionCallable$ExceptionTransformingFuture.onFailure(HttpJsonExceptionCallable.java:97)
com.google.api.core.ApiFutures$1.onFailure(ApiFutures.java:67)
[...]
Suppressed: com.google.api.gax.rpc.AsyncTaskException: Asynchronous task failed
com.google.api.gax.rpc.ApiExceptions.callAndTranslateApiException(ApiExceptions.java:57)
com.google.api.gax.rpc.UnaryCallable.call(UnaryCallable.java:112)
com.google.cloud.compute.v1.NetworkFirewallPoliciesClient.get(NetworkFirewallPoliciesClient.java:687)
com.google.cloud.compute.v1.NetworkFirewallPoliciesClient.get(NetworkFirewallPoliciesClient.java:662)
com.google.cloud.compute.v1.NetworkFirewallPoliciesClientTest.getTest(NetworkFirewallPoliciesClientTest.java:388)
[...]
Caused by: java.lang.RuntimeException: Generated message class "com.google.cloud.compute.v1.FirewallPolicy" missing method "getAssociationsList".
com.google.protobuf.GeneratedMessageV3.getMethodOrDie(GeneratedMessageV3.java:1847)
com.google.protobuf.GeneratedMessageV3.access$1000(GeneratedMessageV3.java:79)
com.google.protobuf.GeneratedMessageV3$FieldAccessorTable$RepeatedFieldAccessor$ReflectionInvoker.<init>(GeneratedMessageV3.java:2409)
com.google.protobuf.GeneratedMessageV3$FieldAccessorTable$RepeatedFieldAccessor.<init>(GeneratedMessageV3.java:2479)
com.google.protobuf.GeneratedMessageV3$FieldAccessorTable$RepeatedMessageFieldAccessor.<init>(GeneratedMessageV3.java:3004)
[...]
Caused by: java.lang.NoSuchMethodException: com.google.cloud.compute.v1.FirewallPolicy.getAssociationsList()
java.lang.Class.getMethod(DynamicHub.java:1114)
com.google.protobuf.GeneratedMessageV3.getMethodOrDie(GeneratedMessageV3.java:1844)
[...]
Be careful. GraalVM native test runs 1309 test cases across 90 test files.
|
Merge-on-green attempted to merge your PR for 6 hours, but it was not mergeable because either one of your required status checks failed, one of your required reviews was not approved, or there is a do not merge label. Learn more about your required status checks here: https://help.github.com/en/github/administering-a-repository/enabling-required-status-checks. You can remove and reapply the label to re-run the bot. |
|
@suztomo It looks like the tests were failing because the configurations in GAX weren't getting picked up by the tests. Here is draft PR that worked locally: https://github.com/googleapis/java-compute/pull/688/files. The |
|
Fantastic. I didn't notice that we can leverage |

Fixes #685
I didn't see the ending of the error message approach, where I update the list and wait 30 min to get error and repeat. It already reached ~500 classes (0425a99). So I try registering all classes in the proto directory for reflection: