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

Tool to run build libraries using LTS BOM #1982

Closed
wants to merge 103 commits into from
Closed

Tool to run build libraries using LTS BOM #1982

wants to merge 103 commits into from

Conversation

suztomo
Copy link
Contributor

@suztomo suztomo commented Mar 16, 2021

This PR is the implementation of the idea #1974 .

  • Test input YAML file ("repositories.yaml" for java-spanner and grpc-java as example) that lists test cases for the Git repositories.
    Each test case has commands on how to execute tests
  • LtsCompatibilityChecker does the followings:
    • It checks out the repository with a tag in a temporary directory.
    • It inserts the LTS BOM to build.gradle and pom.xml.
    • It runs the command to run the tests.
  • LtsBomCompatibilityTest reads the YAML file and selects test case for lts.test.repository system property. It then runs the LtsCompatibilityTestRunner for the case.
  • lts-test/action.yaml defines "LTS Test" GitHub Actions as a composite run step action.
    In future, the repositories of the libraries in the LTS BOM will reference it. (PR for an example installation)
  • .github/workflow/lts-test.yaml triggers to use the GitHub Actions within this repository.

This is for the upcoming release. For the long-term, we want to a better approach that distribute responsibilities to library owners.

@google-cla google-cla bot added the cla: yes label Mar 16, 2021
Comment on lines 196 to 199
if ("guava".equals(artifactId)) {
// Guava JRE does not work with Yoshi's shared config.
// https://github.com/GoogleCloudPlatform/cloud-opensource-java/issues/1974#issuecomment-799862063
continue;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an unexpected blocker when building the project with Guava's JRE flavor.

Comment on lines 115 to 123
// Modify build file to use the BOM
if ("Maven".equals(modification)) {
modifyPomFiles(testRoot, bom);
} else if ("Gradle".equals(modification)) {
modifyGradleFiles(testRoot, bom);
} else {
System.out.println("Invalid value for modification. 'Maven' or 'Gradle'");
break;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the modification parameter "Maven" or "Gradle", it updates the build configuration files.

- name: java-spanner
url: https://github.com/googleapis/java-spanner.git
tag: v5.1.0
modification: Maven
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- name: gRPC
url: https://github.com/grpc/grpc-java.git
tag: v1.36.0
modification: Gradle
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Gradle" updates build.gradle files.



List<String> replacedLines = lines.stream().map(line -> line.replaceAll("^dependencies \\{",
"dependencies {\n testRuntime enforcedPlatform('"+bomCoordinates+"')")).collect(Collectors.toList());
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gradle can configure runtime of test. How about Maven?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Command line option to override "1.7" part of the compiler plugin?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can I configure surefire plugin to add special class path?

<dependency>
<groupId>xom</groupId>
<artifactId>xom</artifactId>
<version>1.3.5</version>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1.3.6 is out

throws IOException, ArtifactDescriptorException, InterruptedException, ParsingException {
String inputFileName = arguments[0];

Yaml yaml = new Yaml();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (buildStatusCode != 0) {
System.out
.println("Failed to build " + url + ". Exiting. Check the logs in " + projectDirectory);
break;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we might want to build the others anyway

@suztomo
Copy link
Contributor Author

suztomo commented Mar 22, 2021

With bom: com.google.api:gax-bom:1.34.0 (very old), I confirmed that the tool detects tests do not succeed.

Root directory: /var/folders/2d/zj9lyxqn7sb_0986sl5hyk9h00kd2p/T/lts-test3809289063269213070
java-spanner: https://github.com/googleapis/java-spanner.git at v5.1.0
Failed to build https://github.com/googleapis/java-spanner.git. Exiting. Check the logs in /var/folders/2d/zj9lyxqn7sb_0986sl5hyk9h00kd2p/T/lts-test3809289063269213070/java-spanner
```

tag: v0.18.0
modification: Gradle
commands: |
perl -i -p -e 's/mavenCentral\(\)/mavenCentral\(\)\nmavenLocal\(\)/;' build.gradle
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's do this in the "modification" step.

@suztomo
Copy link
Contributor Author

suztomo commented Mar 29, 2021

I'll make this as GitHub Actions.

@suztomo
Copy link
Contributor Author

suztomo commented Mar 30, 2021

Now I need the LTS BOM snapshot in the master branch.

[FATAL] Non-readable POM /home/runner/work/cloud-opensource-java/cloud-opensource-java/lts-test/../boms/cloud-lts-bom/pom.xml: /home/runner/work/cloud-opensource-java/cloud-opensource-java/lts-test/../boms/cloud-lts-bom/pom.xml (No such file or directory)

@suztomo
Copy link
Contributor Author

suztomo commented Apr 1, 2021

This grpc-java failure (https://github.com/GoogleCloudPlatform/cloud-opensource-java/pull/1982/checks?check_run_id=2242270199) may be true positive:

io.grpc.auth.GoogleAuthLibraryCallCredentialsTest > jwtAccessCredentialsInRequestMetadata FAILED
    org.junit.ComparisonFailure: expected:<https://example.com[:123/a.service]> but was:<https://example.com[/]>
        at org.junit.Assert.assertEquals(Assert.java:115)
        at org.junit.Assert.assertEquals(Assert.java:144)
        at io.grpc.auth.GoogleAuthLibraryCallCredentialsTest.jwtAccessCredentialsInRequestMetadata(GoogleAuthLibraryCallCredentialsTest.java:397)

Experiment

With the following experiment, I think this is the behavior change incompatibility we want to catch through this testing tool (no compilation error).

Checkout grpc-java at v1.36.1:

suztomo-macbookpro44% git checkout v1.36.1
Previous HEAD position was a53234926 Bump version to 1.36.0
HEAD is now at 2c56ed86d Bump version to 1.36.1

Modify the googleauthVersion for com.google.auth:google-auth-library-credentials:${googleauthVersion}:

suztomo-macbookpro44% git diff
diff --git a/build.gradle b/build.gradle
index 9baf8e029..81fbc4d86 100644
--- a/build.gradle
+++ b/build.gradle
@@ -56,7 +56,7 @@ subprojects {
 
         nettyVersion = '4.1.52.Final'
         guavaVersion = '30.0-android'
-        googleauthVersion = '0.22.2'
+        googleauthVersion = '0.25.2'
         protobufVersion = '3.12.0'
         protocVersion = protobufVersion
         opencensusVersion = '0.28.0'

Run the test. It fails:

suztomo-macbookpro44% ./gradlew :grpc-auth:test
*** Skipping the build of codegen and compilation of proto files because skipCodegen=true
  * Skipping the build of Android projects because skipAndroid=true

> Task :grpc-auth:test

io.grpc.auth.GoogleAuthLibraryCallCredentialsTest > jwtAccessCredentialsInRequestMetadata FAILED
    org.junit.ComparisonFailure: expected:<https://example.com[:123/a.service]> but was:<https://example.com[/]>
        at org.junit.Assert.assertEquals(Assert.java:115)
        at org.junit.Assert.assertEquals(Assert.java:144)
        at io.grpc.auth.GoogleAuthLibraryCallCredentialsTest.jwtAccessCredentialsInRequestMetadata(GoogleAuthLibraryCallCredentialsTest.java:397)

16 tests completed, 1 failed

> Task :grpc-auth:test FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':grpc-auth:test'.
> There were failing tests. See the report at: file:///Users/suztomo/grpc-java/auth/build/reports/tests/test/index.html

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 13s
15 actionable tasks: 2 executed, 13 up-to-date

@suztomo
Copy link
Contributor Author

suztomo commented Apr 1, 2021

With jre/lib/ext approach, Maven stopped working. Probably due to Guava.

constituent[0]: file:/usr/share/apache-maven-3.6.3/conf/logging/
constituent[1]: file:/usr/share/apache-maven-3.6.3/lib/jsr250-api-1.0.jar
constituent[2]: file:/usr/share/apache-maven-3.6.3/lib/maven-artifact-3.6.3.jar
constituent[3]: file:/usr/share/apache-maven-3.6.3/lib/plexus-utils-3.2.1.jar
constituent[4]: file:/usr/share/apache-maven-3.6.3/lib/maven-embedder-3.6.3.jar
constituent[5]: file:/usr/share/apache-maven-3.6.3/lib/maven-plugin-api-3.6.3.jar
constituent[6]: file:/usr/share/apache-maven-3.6.3/lib/javax.inject-1.jar
constituent[7]: file:/usr/share/apache-maven-3.6.3/lib/guice-4.2.1-no_aop.jar
constituent[8]: file:/usr/share/apache-maven-3.6.3/lib/maven-model-3.6.3.jar
constituent[9]: file:/usr/share/apache-maven-3.6.3/lib/plexus-interpolation-1.25.jar
constituent[10]: file:/usr/share/apache-maven-3.6.3/lib/maven-resolver-connector-basic-1.4.1.jar
constituent[11]: file:/usr/share/apache-maven-3.6.3/lib/commons-lang3-3.8.1.jar
constituent[12]: file:/usr/share/apache-maven-3.6.3/lib/jansi-1.17.1.jar
constituent[13]: file:/usr/share/apache-maven-3.6.3/lib/maven-slf4j-provider-3.6.3.jar
constituent[14]: file:/usr/share/apache-maven-3.6.3/lib/maven-settings-builder-3.6.3.jar
constituent[15]: file:/usr/share/apache-maven-3.6.3/lib/jsoup-1.12.1.jar
constituent[16]: file:/usr/share/apache-maven-3.6.3/lib/maven-resolver-impl-1.4.1.jar
constituent[17]: file:/usr/share/apache-maven-3.6.3/lib/maven-resolver-util-1.4.1.jar
constituent[18]: file:/usr/share/apache-maven-3.6.3/lib/maven-resolver-spi-1.4.1.jar
constituent[19]: file:/usr/share/apache-maven-3.6.3/lib/org.eclipse.sisu.plexus-0.3.4.jar
constituent[20]: file:/usr/share/apache-maven-3.6.3/lib/commons-cli-1.4.jar
constituent[21]: file:/usr/share/apache-maven-3.6.3/lib/cdi-api-1.0.jar
constituent[22]: file:/usr/share/apache-maven-3.6.3/lib/wagon-file-3.3.4.jar
constituent[23]: file:/usr/share/apache-maven-3.6.3/lib/org.eclipse.sisu.inject-0.3.4.jar
constituent[24]: file:/usr/share/apache-maven-3.6.3/lib/maven-resolver-api-1.4.1.jar
constituent[25]: file:/usr/share/apache-maven-3.6.3/lib/slf4j-api-1.7.29.jar
constituent[26]: file:/usr/share/apache-maven-3.6.3/lib/maven-resolver-transport-wagon-1.4.1.jar
constituent[27]: file:/usr/share/apache-maven-3.6.3/lib/maven-settings-3.6.3.jar
constituent[28]: file:/usr/share/apache-maven-3.6.3/lib/maven-repository-metadata-3.6.3.jar
constituent[29]: file:/usr/share/apache-maven-3.6.3/lib/jcl-over-slf4j-1.7.29.jar
constituent[30]: file:/usr/share/apache-maven-3.6.3/lib/wagon-provider-api-3.3.4.jar
constituent[31]: file:/usr/share/apache-maven-3.6.3/lib/maven-resolver-provider-3.6.3.jar
constituent[32]: file:/usr/share/apache-maven-3.6.3/lib/maven-compat-3.6.3.jar
constituent[33]: file:/usr/share/apache-maven-3.6.3/lib/guava-25.1-android.jar
constituent[34]: file:/usr/share/apache-maven-3.6.3/lib/maven-core-3.6.3.jar
constituent[35]: file:/usr/share/apache-maven-3.6.3/lib/commons-io-2.5.jar
constituent[36]: file:/usr/share/apache-maven-3.6.3/lib/plexus-sec-dispatcher-1.4.jar
constituent[37]: file:/usr/share/apache-maven-3.6.3/lib/maven-shared-utils-3.2.1.jar
constituent[38]: file:/usr/share/apache-maven-3.6.3/lib/maven-builder-support-3.6.3.jar
constituent[39]: file:/usr/share/apache-maven-3.6.3/lib/plexus-cipher-1.7.jar
constituent[40]: file:/usr/share/apache-maven-3.6.3/lib/wagon-http-3.3.4-shaded.jar
constituent[41]: file:/usr/share/apache-maven-3.6.3/lib/plexus-component-annotations-2.1.0.jar
constituent[42]: file:/usr/share/apache-maven-3.6.3/lib/maven-model-builder-3.6.3.jar
---------------------------------------------------
Error: Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/util/concurrent/internal/InternalFutureFailureAccess
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:757)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:419)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:352)
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:757)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:419)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:352)
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:757)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:419)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:352)
	at com.google.common.cache.LocalCache$LoadingValueReference.<init>(LocalCache.java:3472)
	at com.google.common.cache.LocalCache$LoadingValueReference.<init>(LocalCache.java:3476)
	at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2134)
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2045)
	at com.google.common.cache.LocalCache.get(LocalCache.java:3951)
	at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3974)
	at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4935)
	at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4941)
	at com.google.inject.internal.Annotations$AnnotationChecker.hasAnnotations(Annotations.java:274)
	at com.google.inject.internal.Annotations.isBindingAnnotation(Annotations.java:340)
	at com.google.inject.Key.ensureIsBindingAnnotation(Key.java:349)
	at com.google.inject.Key.strategyFor(Key.java:336)
	at com.google.inject.Key.get(Key.java:219)
	at org.eclipse.sisu.wire.ParameterKeys.<clinit>(ParameterKeys.java:28)
	at org.eclipse.sisu.wire.DependencyAnalyzer.<init>(DependencyAnalyzer.java:93)
	at org.eclipse.sisu.wire.ElementAnalyzer.<init>(ElementAnalyzer.java:104)
	at org.eclipse.sisu.wire.WireModule.configure(WireModule.java:74)
	at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:344)
	at com.google.inject.spi.Elements.getElements(Elements.java:103)
	at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:137)
	at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:103)
	at com.google.inject.Guice.createInjector(Guice.java:87)
	at com.google.inject.Guice.createInjector(Guice.java:69)
	at com.google.inject.Guice.createInjector(Guice.java:59)
	at org.codehaus.plexus.DefaultPlexusContainer.addPlexusInjector(DefaultPlexusContainer.java:481)
	at org.codehaus.plexus.DefaultPlexusContainer.<init>(DefaultPlexusContainer.java:206)
	at org.apache.maven.cli.MavenCli.container(MavenCli.java:636)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:282)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:193)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
Caused by: java.lang.ClassNotFoundException: com.google.common.util.concurrent.internal.InternalFutureFailureAccess
	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:419)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:352)
	... 70 more

Comment on lines 56 to 60
if ("guava".equals(artifact.getArtifactId())) {
// Placing Guava in the ext directory stops Maven
continue;
}
Copy link
Contributor Author

@suztomo suztomo Apr 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To avoid Maven-guava problem, I excluded Guava from being copied to jre/lib/ext. But now GitHub Actions get lots errors (link):

Error:  com.google.api.client.http.BasicAuthenticationTest.testConstructor  Time elapsed: 0 s  <<< ERROR!
java.lang.NoClassDefFoundError: com/google/common/base/Preconditions
	at com.google.api.client.http.BasicAuthenticationTest.testConstructor(BasicAuthenticationTest.java:35)

[INFO] Running com.google.api.client.http.HttpResponseExceptionTest
Error:  Tests run: 10, Failures: 0, Errors: 10, Skipped: 0, Time elapsed: 0 s <<< FAILURE! - in com.google.api.client.http.HttpResponseExceptionTest
Error:  com.google.api.client.http.HttpResponseExceptionTest.testConstructor_messageButNoStatusCode  Time elapsed: 0 s  <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class com.google.api.client.testing.http.HttpTesting
	at com.google.api.client.http.HttpResponseExceptionTest.testConstructor_messageButNoStatusCode(HttpResponseExceptionTest.java:141)

Maybe the classes in jre/lib/ext cannot reference to the classes not in jre/lib/ext?

ClassLoader

With simple debug print statements, it shows that BasicAuthentication's class loader is ExtClassLoader:

[INFO] Running com.google.api.client.http.BasicAuthenticationTest
BasicAuthenticationTest's class loader: sun.misc.Launcher$AppClassLoader@5674cd4d
BasicAuthentication's class loader: sun.misc.Launcher$ExtClassLoader@50675690

My removal of Guava from JRE's ext class loader caused the following issues:

  1. BasicAuthentication tried to load Guava's Preconditions class.
  2. The class loader (extension class loader) cannot find it. It tries to ask its parent class loader
  3. The parent class loader (bootstrap loader) cannot find it.
  4. Therefore, the class was not found, without searching in the application class loader.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maven debug output: https://gist.github.com/suztomo/b596e02a09bd35b2426ae0f3014e083e

When I remove google-http-client.jar from jre/lib/ext, then BasicAuthenticationTest succeeds.

Analysis

BasicAuthenticationTest calls BasicAuthentication class. Because BasicAuthentication was in jre/lib/ext's google-http-client.jar, JVM loaded the class from the JAR file, not from the Maven project. Because the class is from ext directory, it cannot reference the Guavas' Precondition class because Guava is not in jre/lib/ext. Guava is the Maven project's dependency.

@suztomo
Copy link
Contributor Author

suztomo commented Apr 1, 2021

Digging bigtable-hbase-beam's errors:

Missing TableRow

java.lang.NoClassDefFoundError: com/google/api/services/bigquery/model/TableRow
	at org.apache.beam.sdk.io.gcp.bigquery.BigQueryCoderProviderRegistrar.getCoderProviders(BigQueryCoderProviderRegistrar.java:34)
	at org.apache.beam.sdk.coders.CoderRegistry.<clinit>(CoderRegistry.java:174)
	at com.google.cloud.bigtable.beam.CloudBigtableIOTest.<clinit>(CloudBigtableIOTest.java:64)

com.google.apis:google-api-services-bigquery:v2-rev20200719-1.30.10 has the TableRow class.

org.apache.beam:beam-sdks-java-io-google-cloud-platform:2.24.0 has the BigQueryCoderProviderRegistrar class.

With this debugging session below, it seems that original revision does not touch BigQueryCoderProviderRegistrar class. This implies that org.apache.beam.sdk.coders.CoderRegistry's behavior has changed between 2.24 and 2.28.

mvn test -pl bigtable-dataflow-parent/bigtable-hbase-beam  -Dclirr.skip=true   -Denforcer.skip=true  -Dmaven.javadoc.skip=true -Dgcloud.download.skip=true -Dtest=com.google.cloud.bigtable.beam.CloudBigtableIOTest   -Dmaven.surefire.debug

The class path for surefire plugin does not include google-api-services-bigquery (gist). This must be new dependency.

Mockito canont mock CloudBigtableIO$AbstractSource

[ERROR] Tests run: 3, Failures: 0, Errors: 3, Skipped: 0, Time elapsed: 0.793 s <<< FAILURE! - in com.google.cloud.bigtable.beam.CloudBigtableIOReaderTest
[ERROR] testBasic(com.google.cloud.bigtable.beam.CloudBigtableIOReaderTest)  Time elapsed: 0.755 s  <<< ERROR!
org.mockito.exceptions.base.MockitoException: 

Mockito cannot mock this class: class com.google.cloud.bigtable.beam.CloudBigtableIO$AbstractSource.

Mockito can only mock non-private & non-final classes.

@suztomo
Copy link
Contributor Author

suztomo commented Apr 2, 2021

java-bigquery

java.lang.NoSuchMethodError: com.google.api.services.bigquery.model.Dataset$Access.setRoutine(Lcom/google/api/services/bigquery/model/RoutineReference;)Lcom/google/api/services/bigquery/model/Dataset$Access;
	at com.google.cloud.bigquery.Acl$Routine.toPb(Acl.java:442)
	at com.google.cloud.bigquery.Acl.toPb(Acl.java:552)
	at com.google.cloud.bigquery.Acl.toString(Acl.java:536)
	at com.google.cloud.BaseSerializationTest.testSerializableObjects(BaseSerializationTest.java:53)

google-api-services-bigquery-v2-rev20210313-1.31.0.jar has Access#.setRoutine. The BOM dashboard tells the linkage error https://storage.googleapis.com/cloud-opensource-java-dashboard/com.google.cloud/gcp-lts-bom/snapshot/com.google.cloud_google-cloud-bigquery_1.127.11.html

The following linkage error is also in the dashboard:

java.lang.NoSuchMethodError: com.google.api.services.bigquery.model.HivePartitioningOptions.setRequirePartitionFilter(Ljava/lang/Boolean;)Lcom/google/api/services/bigquery/model/HivePartitioningOptions;
	at com.google.cloud.bigquery.HivePartitioningOptions.toPb(HivePartitioningOptions.java:151)
	at com.google.cloud.bigquery.HivePartitioningOptionsTest.testToAndFromPb(HivePartitioningOptionsTest.java:63)

java-monitoring

com.google.api.MetricDescriptor is from com.google.api.grpc:proto-google-common-protos.

java.lang.NoSuchMethodError: com.google.api.MetricDescriptor$Builder.addAllMonitoredResourceTypes(Ljava/lang/Iterable;)Lcom/google/api/MetricDescriptor$Builder;
	at com.google.cloud.monitoring.v3.MetricServiceClientTest.getMetricDescriptorTest(MetricServiceClientTest.java:579)

com.google.api.grpc:proto-google-common-protos:2.1.0 has the method. The dependencies from the BOM fetched proto-google-common-protos-1.18.1.jar, which does not have the method.

suztomo-macbookpro44% javap -cp  ~/.m2/repository/com/google/api/grpc/proto-google-common-protos/1.18.1/proto-google-common-protos-1.18.1.jar 'com.google.api.MetricDescriptor$Builder' |grep addAll
  public com.google.api.MetricDescriptor$Builder addAllLabels(java.lang.Iterable<? extends com.google.api.LabelDescriptor>);
suztomo-macbookpro44% javap -cp  ~/.m2/repository/com/google/api/grpc/proto-google-common-protos/2.1.0/proto-google-common-protos-2.1.0.jar 'com.google.api.MetricDescriptor$Builder' |grep addAll
  public com.google.api.MetricDescriptor$Builder addAllLabels(java.lang.Iterable<? extends com.google.api.LabelDescriptor>);
  public com.google.api.MetricDescriptor$Builder addAllMonitoredResourceTypes(java.lang.Iterable<java.lang.String>);

@suztomo
Copy link
Contributor Author

suztomo commented Apr 2, 2021

Some of the test in Beam throw credential error due to the runtime environment not having default credential.

> Task :sdks:java:io:google-cloud-platform:test

org.apache.beam.sdk.io.gcp.healthcare.DicomIOTest > test_Dicom_failedMetadataRead FAILED
    org.apache.beam.vendor.guava.v26_0_jre.com.google.common.util.concurrent.UncheckedExecutionException at LocalCache.java:2050
        Caused by: org.apache.beam.sdk.util.UserCodeException at UserCodeException.java:39
            Caused by: java.io.IOException at DefaultCredentialsProvider.java:134

org.apache.beam.sdk.io.gcp.healthcare.HL7v2IOTest > test_HL7v2IO_failedReads FAILED
    org.apache.beam.vendor.guava.v26_0_jre.com.google.common.util.concurrent.UncheckedExecutionException at LocalCache.java:2050
        Caused by: org.apache.beam.sdk.util.UserCodeException at UserCodeException.java:39
            Caused by: java.io.IOException at DefaultCredentialsProvider.java:134

org.apache.beam.sdk.io.gcp.healthcare.HL7v2IOTest > test_HL7v2IO_failedWrites FAILED
    org.apache.beam.vendor.guava.v26_0_jre.com.google.common.util.concurrent.UncheckedExecutionException at LocalCache.java:2050
        Caused by: org.apache.beam.sdk.util.UserCodeException at UserCodeException.java:39
            Caused by: java.io.IOException at DefaultCredentialsProvider.java:134

org.apache.beam.sdk.io.gcp.healthcare.FhirIOTest > test_FhirIO_failedReads FAILED
    org.apache.beam.vendor.guava.v26_0_jre.com.google.common.util.concurrent.UncheckedExecutionException at LocalCache.java:2050
        Caused by: org.apache.beam.sdk.util.UserCodeException at UserCodeException.java:39
            Caused by: java.io.IOException at DefaultCredentialsProvider.java:134

org.apache.beam.sdk.io.gcp.healthcare.FhirIOTest > test_FhirIO_failedSearches FAILED
    org.apache.beam.vendor.guava.v26_0_jre.com.google.common.util.concurrent.UncheckedExecutionException at LocalCache.java:2050
        Caused by: org.apache.beam.sdk.util.UserCodeException at UserCodeException.java:39
            Caused by: java.io.IOException at DefaultCredentialsProvider.java:134

org.apache.beam.sdk.io.gcp.healthcare.FhirIOTest > test_FhirIO_failedSearchesWithGenericParameters FAILED
    org.apache.beam.vendor.guava.v26_0_jre.com.google.common.util.concurrent.UncheckedExecutionException at LocalCache.java:2050
        Caused by: org.apache.beam.sdk.util.UserCodeException at UserCodeException.java:39
            Caused by: java.io.IOException at DefaultCredentialsProvider.java:134

org.apache.beam.sdk.io.gcp.healthcare.FhirIOTest > test_FhirIO_failedWrites FAILED
    org.apache.beam.vendor.guava.v26_0_jre.com.google.common.util.concurrent.UncheckedExecutionException at LocalCache.java:2050
        Caused by: org.apache.beam.sdk.util.UserCodeException at UserCodeException.java:39
            Caused by: java.io.IOException at DefaultCredentialsProvider.java:134

648 tests completed, 7 failed

To investigate precondition further.

@suztomo
Copy link
Contributor Author

suztomo commented Apr 9, 2021

google-cloud-storage failed with obscure message.

Error:  There was an error in the forked process
Error:  com/google/cloud/BaseSerializationTest
Error:  org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process
Error:  com/google/cloud/BaseSerializationTest
Error:  	at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:733)

How can I print the error message or stack trace of the forked process?

I ran it locally and got NoClassDefFoundError:

suztomo-macbookpro44% cat 2021-04-09T11-10-36_172-jvmRun1.dump
# Created at 2021-04-09T11:10:38.147
java.lang.NoClassDefFoundError: com/google/cloud/BaseSerializationTest
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at org.apache.maven.surefire.api.util.DefaultScanResult.loadClass(DefaultScanResult.java:136)
	at org.apache.maven.surefire.api.util.DefaultScanResult.applyFilter(DefaultScanResult.java:100)
	at org.apache.maven.surefire.junitcore.JUnitCoreProvider.scanClassPath(JUnitCoreProvider.java:292)
	at org.apache.maven.surefire.junitcore.JUnitCoreProvider.setTestsToRun(JUnitCoreProvider.java:198)
	at org.apache.maven.surefire.junitcore.JUnitCoreProvider.invoke(JUnitCoreProvider.java:132)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:428)
	at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162)
	at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:562)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:548)
Caused by: java.lang.ClassNotFoundException: com.google.cloud.BaseSerializationTest
	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 21 more

Screen Shot 2021-04-09 at 11 14 03

The missing com.google.cloud.BaseSerializationTest is in com.google.cloud:google-cloud-core:test-jar:tests:1.94.3 (extension: test-jar, classifier: tests).

google-cloud-storage/pom.xml has

    <dependency>
      <groupId>com.google.cloud</groupId>
      <artifactId>google-cloud-core</artifactId>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>

This seems because the test tool inserts the test tool regardless of the classifier.

<classpathDependencyExclude>com.google.cloud:google-cloud-core</classpathDependencyExclude>

@suztomo
Copy link
Contributor Author

suztomo commented Apr 9, 2021

java-pubsub suffers from dependency conflict even if this tool uses Gradle dependency resolution

NoClassDefFoundError: com/google/pubsub/v1/SchemaServiceGrpc$SchemaServiceImplBase

The class is in grpc-google-cloud-pubsub-v1: 1.94.0:

Screen Shot 2021-04-09 at 13 33 38

but not in grpc-google-cloud-pubsub-v1-1.90.3.jar

suztomo-macbookpro44% jar tf ~/.m2/repository/com/google/api/grpc/grpc-google-cloud-pubsub-v1/1.90.3/grpc-google-cloud-pubsub-v1-1.90.3.jar |grep SchemaServiceGrpc
suztomo-macbookpro44% 

Why did this choose 1.90.3, which is lower than 1.94.0? Google-cloud-pubsub is not declaring the "proto-google-cloud-pubsub" dependency?

Screen Shot 2021-04-09 at 13 55 11

It's a test dependency

    <dependency>
      <groupId>com.google.api.grpc</groupId>
      <artifactId>grpc-google-cloud-pubsub-v1</artifactId>
      <scope>test</scope>
    </dependency>

This implies we better to control grpc-google-cloud-pubsub-v1's version (probably through a BOM; maybe outside the LTS scope)

@suztomo suztomo mentioned this pull request Apr 9, 2021
Comment on lines 260 to 267
<!-- TODO: review this benefit and cost -->
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-pubsub-bom</artifactId>
<version>${google.cloud.pubsub.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we import pubsub-bom, java-pubsub test succeeds; otherwise it fails with dependency conflict. The lts-bom gets old grpc-google-cloud-pubsub-v1:1.90.3.

Copy link
Contributor Author

@suztomo suztomo Apr 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But this has side-effect to Beam:

> Task :sdks:java:io:google-cloud-platform:test

org.apache.beam.sdk.io.gcp.pubsub.PubsubGrpcClientTest > publishOneMessage FAILED
    io.grpc.StatusRuntimeException at PubsubGrpcClientTest.java:200
        Caused by: java.lang.NoSuchFieldError at PubsubGrpcClientTest.java:200

org.apache.beam.sdk.io.gcp.pubsub.PubsubGrpcClientTest > pullOneMessage FAILED
    io.grpc.StatusRuntimeException at PubsubGrpcClientTest.java:145
        Caused by: java.lang.NoSuchFieldError at PubsubGrpcClientTest.java:145

java.lang.NoSuchFieldError: ATTR_LOAD_BALANCING_CONFIG |  
-- | --
  | at io.grpc.internal.AutoConfiguredLoadBalancerFactory$AutoConfiguredLoadBalancer.tryHandleResolvedAddresses(AutoConfiguredLoadBalancerFactory.java:114) |  
  | at io.grpc.internal.ManagedChannelImpl$NameResolverListener$1NamesResolved.run(ManagedChannelImpl.java:1601) |  
  | at io.grpc.SynchronizationContext.drain(SynchronizationContext.java:95) |  
  | at io.grpc.SynchronizationContext.execute(SynchronizationContext.java:127) |  
  | at io.grpc.internal.ManagedChannelImpl$ChannelStreamProvider.getTransport(ManagedChannelImpl.java:493) |  
  | at io.grpc.internal.ManagedChannelImpl$ChannelStreamProvider.newStream(ManagedChannelImpl.java:523) |  
  | at io.grpc.internal.ClientCallImpl.startInternal(ClientCallImpl.java:245) |  
  | at io.grpc.internal.ClientCallImpl.start(ClientCallImpl.java:204) |  
  | at io.grpc.auth.ClientAuthInterceptor$1.checkedStart(ClientAuthInterceptor.java:87) |  
  | at io.grpc.ClientInterceptors$CheckedForwardingClientCall.start(ClientInterceptors.java:231) |  
  | at io.grpc.stub.ClientCalls.startCall(ClientCalls.java:332) |  
  | at io.grpc.stub.ClientCalls.asyncUnaryRequestCall(ClientCalls.java:306) |  
  | at io.grpc.stub.ClientCalls.futureUnaryCall(ClientCalls.java:218) |  
  | at io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:146) |  
  | at com.google.pubsub.v1.PublisherGrpc$PublisherBlockingStub.publish(PublisherGrpc.java:892) |  
  | at org.apache.beam.sdk.io.gcp.pubsub.PubsubGrpcClient.publish(PubsubGrpcClient.java:206) |  
  | at org.apache.beam.sdk.io.gcp.pubsub.PubsubGrpcClientTest.publishOneMessage(PubsubGrpcClientTest.java:200)

  • grpc-core has AutoConfiguredLoadBalancerFactory$AutoConfiguredLoadBalancer
  • grpc-api has io.grpc.LoadBalancer.

As per Gradle's report, testRuntimeClasspath had grpc-core:1.32.2 and grpc-api:1.36.0. The LoadBalancer class in the new grpc-api does not have ATTR_LOAD_BALANCING_CONFIG field.

Both grpc-core and grpc-api are in the LTS BOM. Why do they have difference?

It seems that the direct dependencies are controlled by the libraries bom if I use "compile" configuration. Moving it to "compileOnly" configuration lets the tool to run the tests with the LTS BOM.

However, making it compileOnly fails the build due to gradle-dependency-analyze plugin unable to find the proper version.

* What went wrong:
Could not determine the dependencies of task ':sdks:java:io:google-cloud-platform:analyzeTestClassesDependencies'.
> Could not resolve all dependencies for configuration ':sdks:java:io:google-cloud-platform:compile'.
   > Could not find com.google.cloud:google-cloud-bigquerystorage:.
     Required by:
         project :sdks:java:io:google-cloud-platform
   > Could not find com.google.cloud:google-cloud-core-grpc:.
     Required by:
         project :sdks:java:io:google-cloud-platform
   > Could not find com.google.cloud:google-cloud-spanner:.
     Required by:
         project :sdks:java:io:google-cloud-platform
   > Could not find io.grpc:grpc-netty:.
     Required by:
         project :sdks:java:io:google-cloud-platform
   > Could not find com.google.api.grpc:grpc-google-cloud-pubsub-v1:.
     Required by:
         project :sdks:java:io:google-cloud-platform
   > Could not find com.google.api.grpc:proto-google-cloud-bigquerystorage-v1beta1:.
     Required by:
         project :sdks:java:io:google-cloud-platform
   > Could not find com.google.api.grpc:proto-google-cloud-spanner-admin-database-v1:.
     Required by:
         project :sdks:java:io:google-cloud-platform

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beam uses force for each direct dependencies. The force function overrides the ones specified by the gcp-lts-bom.

Even if I apply the change:

suztomo-macbookpro44% git diff sdks/java/io/google-cloud-platform/build.gradle                                       
diff --git a/sdks/java/io/google-cloud-platform/build.gradle b/sdks/java/io/google-cloud-platform/build.gradle
index 7ac6878..57bd6d3 100644
--- a/sdks/java/io/google-cloud-platform/build.gradle
+++ b/sdks/java/io/google-cloud-platform/build.gradle
@@ -29,6 +29,8 @@ description = "Apache Beam :: SDKs :: Java :: IO :: Google Cloud Platform"
 ext.summary = "IO library to read and write Google Cloud Platform systems from Beam."
 
 dependencies {
+  compile enforcedPlatform("com.google.cloud:gcp-lts-bom:0.1.0-SNAPSHOT")
+  testRuntime enforcedPlatform("com.google.cloud:gcp-lts-bom:0.1.0-SNAPSHOT")
   compile enforcedPlatform(library.java.google_cloud_platform_libraries_bom)
   compile project(path: ":sdks:java:core", configuration: "shadow")
   compile project(":sdks:java:expansion-service")
suztomo-macbookpro44% ./gradlew  -PdisableSpotlessCheck=true :sdks:java:io:google-cloud-platform:dependencies |pbcopy

The testRuntimeClasspath uses Guava 25.1-jre

testRuntimeClasspath - Runtime classpath of source set 'test'.
+--- org.checkerframework:checker-qual:3.7.0
+--- com.google.cloud:gcp-lts-bom:0.1.0-SNAPSHOT
|    +--- com.google.guava:guava:30.1-jre -> 25.1-jre (c)
|    +--- com.google.protobuf:protobuf-java:3.15.6 -> 3.12.0 (c)
|    +--- io.grpc:grpc-alts:1.36.1 (c)
...

https://gist.github.com/suztomo/c965014ad2a06bf5780894d94c741ebb

Comment on lines 371 to 467
buildGradleContent =
buildGradleContent.replaceAll(
"config.getName\\(\\) != \"errorprone\"",
"![\"errorprone\", \"testRuntimeClasspath\"].contains(config.getName())");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This causes an error where JUnit 4.12 does not have Assert.assertThrows, which is available after 4.13.

java.lang.NoSuchMethodError: org.junit.Assert.assertThrows(Ljava/lang/Class;Lorg/junit/function/ThrowingRunnable;)Ljava/lang/Throwable;
	at org.apache.beam.sdk.values.PCollectionViewsTest.assertNonEmptyRangesAndPositions(PCollectionViewsTest.java:257)
	at org.apache.beam.sdk.values.PCollectionViewsTest.testNestedOverlaps(PCollectionViewsTest.java:204)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now :sdks:java:extensions:google-cloud-platform-core:test somehow uses Guava's Android flavor. The dependencies task shows no Android flavor.

https://scans.gradle.com/s/t6uughjugn3oy/tests/:sdks:java:extensions:google-cloud-platform-core:test/org.apache.beam.sdk.extensions.gcp.util.GcsUtilTest/testNonExistentObjectReturnsEmptyResult?expanded-stacktrace=WyIwIl0#1

java.lang.NoSuchMethodError: com.google.common.cache.CacheBuilder.expireAfterWrite(Ljava/time/Duration;)Lcom/google/common/cache/CacheBuilder;
at com.google.cloud.hadoop.gcsio.GoogleCloudStorageImpl.<init>(GoogleCloudStorageImpl.java:141)	
at org.apache.beam.sdk.extensions.gcp.util.GcsUtil.<init>(GcsUtil.java:201)	
at org.apache.beam.sdk.extensions.gcp.util.GcsUtil.<init>(GcsUtil.java:88)	
at org.apache.beam.sdk.extensions.gcp.util.GcsUtil$GcsUtilFactory.create(GcsUtil.java:110)	
at org.apache.beam.sdk.extensions.gcp.util.GcsUtil$GcsUtilFactory.create(GcsUtil.java:93)	
at org.apache.beam.sdk.options.ProxyInvocationHandler.returnDefaultHelper(ProxyInvocationHandler.java:605)	
at org.apache.beam.sdk.options.ProxyInvocationHandler.getDefault(ProxyInvocationHandler.java:546)	
at org.apache.beam.sdk.options.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:171)	
at com.sun.proxy.$Proxy41.getGcsUtil(Unknown Source)	
at org.apache.beam.sdk.extensions.gcp.util.GcsUtilTest.testNonExistentObjectReturnsEmptyResult(GcsUtilTest.java:317)	
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

@suztomo
Copy link
Contributor Author

suztomo commented Apr 12, 2021

java-bigtable-hbase fails:

Error:  testListBackupsAsync(com.google.cloud.bigtable.grpc.TestBigtableTableAdminGCJClient)  Time elapsed: 0.002 s  <<< ERROR!
io.grpc.ManagedChannelProvider$ProviderNotFoundException: No functional server found. Try adding a dependency on the grpc-netty or grpc-netty-shaded artifact
	at io.grpc.ServerProvider.provider(ServerProvider.java:44)
	at io.grpc.ServerBuilder.forPort(ServerBuilder.java:41)

@suztomo
Copy link
Contributor Author

suztomo commented Apr 12, 2021

grpc-okhttp fails. It fails even with the master branch without modifying build files. Why?

suztomo-macbookpro44% ./gradlew :grpc-okhttp:test --tests=io.grpc.okhttp.OkHttpClientTransportTest
*** Skipping the build of codegen and compilation of proto files because skipCodegen=true
  * Skipping the build of Android projects because skipAndroid=true

> Task :grpc-okhttp:test

io.grpc.okhttp.OkHttpClientTransportTest > proxy_200 FAILED
    org.junit.runners.model.TestTimedOutException: test timed out after 10 seconds
        at java.net.PlainSocketImpl.socketAccept(Native Method)
        at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:409)
        at java.net.ServerSocket.implAccept(ServerSocket.java:545)
        at java.net.ServerSocket.accept(ServerSocket.java:513)
        at io.grpc.okhttp.OkHttpClientTransportTest.proxy_200(OkHttpClientTransportTest.java:1876)

io.grpc.okhttp.OkHttpClientTransportTest > proxy_500 FAILED
    org.junit.runners.model.TestTimedOutException: test timed out after 10 seconds
        at java.net.PlainSocketImpl.socketAccept(Native Method)
        at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:409)
        at java.net.ServerSocket.implAccept(ServerSocket.java:545)
        at java.net.ServerSocket.accept(ServerSocket.java:513)
        at io.grpc.okhttp.OkHttpClientTransportTest.proxy_500(OkHttpClientTransportTest.java:1933)

io.grpc.okhttp.OkHttpClientTransportTest > proxy_immediateServerClose FAILED
    org.junit.runners.model.TestTimedOutException: test timed out after 10 seconds
        at java.net.PlainSocketImpl.socketAccept(Native Method)
        at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:409)
        at java.net.ServerSocket.implAccept(ServerSocket.java:545)
        at java.net.ServerSocket.accept(ServerSocket.java:513)
        at io.grpc.okhttp.OkHttpClientTransportTest.proxy_immediateServerClose(OkHttpClientTransportTest.java:1989)

68 tests completed, 3 failed

Troubleshooting at grpc/grpc-java#8080

@suztomo
Copy link
Contributor Author

suztomo commented May 14, 2021

Your concern is valid and I agree that the test-artifact approach is more robust. That's why this modify-build-file approach is a temporary solution until the test-artifact approach is ready.

If you prefer, we can keep this PR unmerged. Every time we update the LTS BOM, we can click "Update branch" button to run the tests.

@suztomo
Copy link
Contributor Author

suztomo commented May 14, 2021

If you prefer, we can keep this PR unmerged

I think it's better to have the check run on the PRs that touches the LTS BOM.

@suztomo

This comment has been minimized.

@suztomo

This comment has been minimized.

@suztomo
Copy link
Contributor Author

suztomo commented May 19, 2021

It was false positive. The version conflict between gax and gax-grpc. This gax-grpc was not upgraded to the version of the LTS BOM, because the project has its testlib classifier dependency (the tool has special handling for testlib classifier link)

@suztomo
Copy link
Contributor Author

suztomo commented May 27, 2021

gRPC 1.36.2 works fine.

@suztomo
Copy link
Contributor Author

suztomo commented Jun 15, 2021

Beam 2.30 passed.

@suztomo
Copy link
Contributor Author

suztomo commented Jun 24, 2021

google-api-client-appengine passed with appengine-api-1.0-sdk 1.9.89

[INFO] --- maven-surefire-plugin:3.0.0-M5:test (default-test) @ google-api-client-appengine ---
[INFO] 
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.google.api.client.googleapis.extensions.appengine.auth.oauth2.AppIdentityCredentialTest
[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.337 s - in com.google.api.client.googleapis.extensions.appengine.auth.oauth2.AppIdentityCredentialTest
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0

https://github.com/GoogleCloudPlatform/cloud-opensource-java/pull/1982/checks?check_run_id=2900959562

@suztomo suztomo closed this Jul 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants