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

[BEAM-11205] Libraries-BOM 20.0.0 with gRPC and protobuf #14527

Merged
merged 3 commits into from Apr 20, 2021

Conversation

suztomo
Copy link
Contributor

@suztomo suztomo commented Apr 13, 2021

Upgrading the libraries-bom version to 20.0.0 along with gRPC and protobuf.

Changes in mock object setup in failed tests

Some GCP-related tests failed. The latest google-http-client internally calls getStatusCode() twice per HTTP response. This change broke some tests where their mock setups had assumed that the method call occurs only once per request (and the tests were reusing the same mock response object for different responses). I updated the mock setup so that it now prepares different mock response objects for different responses.

Linkage Check

No new linkage errors. https://gist.github.com/suztomo/ac11c74fb24ebb8ac0e11791a8be11a9

Initially it had problem with old gax-httpjson used by google-cloud-bigquerystorage (log). Declaring gax-httpjson as a dependency of google-cloud-platform module fixed the linkage errors.


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Choose reviewer(s) and mention them in a comment (R: @username).
  • Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

Post-Commit Tests Status (on master branch)

Lang SDK ULR Dataflow Flink Samza Spark Twister2
Go Build Status --- Build Status Build Status --- Build Status ---
Java Build Status Build Status Build Status
Build Status
Build Status
Build Status
Build Status Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status Build Status
Build Status
Build Status
Build Status
Python Build Status
Build Status
Build Status
--- Build Status
Build Status
Build Status
Build Status
Build Status
--- Build Status ---
XLang Build Status --- Build Status Build Status --- Build Status ---

Pre-Commit Tests Status (on master branch)

--- Java Python Go Website Whitespace Typescript
Non-portable Build Status
Build Status
Build Status
Build Status
Build Status
Build Status Build Status Build Status Build Status
Portable --- Build Status Build Status --- --- ---

See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests

See CI.md for more information about GitHub Actions CI.

@codecov
Copy link

codecov bot commented Apr 13, 2021

Codecov Report

Merging #14527 (f03a076) into master (faaf646) will decrease coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #14527      +/-   ##
==========================================
- Coverage   83.62%   83.61%   -0.01%     
==========================================
  Files         445      445              
  Lines       59027    59027              
==========================================
- Hits        49359    49358       -1     
- Misses       9668     9669       +1     
Impacted Files Coverage Δ
.../python/apache_beam/examples/dataframe/taxiride.py
...s/python/apache_beam/io/aws/clients/s3/messages.py
...he_beam/runners/interactive/caching/write_cache.py
...ransforms/transforms_keyword_only_args_test_py3.py
...eam/runners/portability/fn_api_runner/fn_runner.py
...am/examples/snippets/transforms/aggregation/min.py
...on/apache_beam/runners/portability/flink_runner.py
...e_beam/runners/portability/abstract_job_service.py
...rcs/sdks/python/apache_beam/io/hadoopfilesystem.py
...s/python/apache_beam/runners/portability/stager.py
... and 880 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update faaf646...f03a076. Read the comment docs.

@suztomo
Copy link
Contributor Author

suztomo commented Apr 13, 2021

Run Java_Examples_Dataflow PreCommit

@suztomo
Copy link
Contributor Author

suztomo commented Apr 13, 2021

Run PythonLint PreCommit

@suztomo suztomo changed the title Libraries-BOM 20.0.0 with gRPC and protobuf [BEAM-11205] Libraries-BOM 20.0.0 with gRPC and protobuf Apr 13, 2021
@suztomo
Copy link
Contributor Author

suztomo commented Apr 13, 2021

Run PythonLint PreCommit

@suztomo
Copy link
Contributor Author

suztomo commented Apr 13, 2021

:sdks:java:core:compileTestJava failed:

> Task :sdks:java:core:compileTestJava
/Users/suztomo/beam/sdks/java/core/src/test/java/org/apache/beam/sdk/metrics/MetricsTest.java:450: error: incompatible types: inferred type does not conform to lower bound(s)
    assertThat(
              ^
    inferred: MetricResult<DistributionResult>
    lower bound(s): CAP#1,MetricResult<DistributionResult>
  where CAP#1 is a fresh type-variable:
    CAP#1 extends Object super: MetricResult<DistributionResult> from capture of ? super MetricResult<DistributionResult>

MetricsTest.java:450 has

    assertThat(
        metrics.getDistributions(),
        anyOf(
            // Step names are different for portable and non-portable runners.
            hasItem(
                (Matcher<MetricResult<DistributionResult>>)
                    distributionMinMax(
                        NAMESPACE,
                        "bundle",
                        "MyStep1/ParMultiDo(Anonymous)",
                        10L,
                        40L,
                        isCommitted)),
            hasItem(
                (Matcher<MetricResult<DistributionResult>>)
                    distributionMinMax(
                        NAMESPACE,
                        "bundle",
                        "MyStep1-ParMultiDo-Anonymous-",
                        10L,
                        40L,
                        isCommitted))));

Interestingly, the :sdks:java:core:compileTestJava succeeds 56 times out of 77 attempts (without using build cache):

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

My first time to see such randomness in Java build.

Cham is working on fixing the test.

@suztomo

This comment has been minimized.

@suztomo suztomo force-pushed the libraries-bom_20 branch 3 times, most recently from f1b6d20 to 7fe131c Compare April 15, 2021 00:12
@@ -502,7 +502,9 @@ public void testGetSizeBytesWhenFileNotFoundBatchRetry() throws Exception {

// 429: Too many requests, then 200: OK.
when(mockResponse.getStatusCode()).thenReturn(429, 200);
when(mockResponse.getContent()).thenReturn(toStream("error"), toStream(content));
// Google-http-client:1.39.1 and above does not read content stream of the error response.
Copy link
Contributor

Choose a reason for hiding this comment

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

This should not be true unless disconnect is being called somewhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks. I'll create a test case for google-http-java-client to verify this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It turned out that it was mock setup that had wrong assumption that getStatusCode is called once per response.

@suztomo
Copy link
Contributor Author

suztomo commented Apr 16, 2021

Run Java Postcommit

@suztomo
Copy link
Contributor Author

suztomo commented Apr 16, 2021

Run GoPortable PreCommit

@suztomo
Copy link
Contributor Author

suztomo commented Apr 16, 2021

Run Java_Examples_Dataflow PreCommit

@suztomo
Copy link
Contributor Author

suztomo commented Apr 16, 2021

Run Python PreCommit

@suztomo
Copy link
Contributor Author

suztomo commented Apr 16, 2021

Run PostCommit_Java_Hadoop_Versions

@suztomo
Copy link
Contributor Author

suztomo commented Apr 16, 2021

Run PostCommit_Java_Dataflow

@suztomo
Copy link
Contributor Author

suztomo commented Apr 16, 2021

Run PostCommit_Java_DataflowV2

@suztomo
Copy link
Contributor Author

suztomo commented Apr 16, 2021

Run Java HadoopFormatIO Performance Test

@suztomo
Copy link
Contributor Author

suztomo commented Apr 16, 2021

Run BigQueryIO Streaming Performance Test Java

@suztomo
Copy link
Contributor Author

suztomo commented Apr 16, 2021

Run Dataflow ValidatesRunner

@suztomo
Copy link
Contributor Author

suztomo commented Apr 17, 2021

Run Java_Examples_Dataflow PreCommit

@suztomo suztomo marked this pull request as ready for review April 17, 2021 00:19
@suztomo
Copy link
Contributor Author

suztomo commented Apr 17, 2021

Run PostCommit_Java_DataflowV2

@suztomo
Copy link
Contributor Author

suztomo commented Apr 17, 2021

34 successful checks!

@suztomo
Copy link
Contributor Author

suztomo commented Apr 17, 2021

Run Java Precommit

Copy link
Contributor

@Fokko Fokko left a comment

Choose a reason for hiding this comment

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

Thanks for picking this up @suztomo Looking good!

Since google-http-client 1.39.1, it started to call getStatusCode
twice per a response. However certain tests assumed that the
method was called once per response and reused the same mock
response object. The test shouldn't assume getStatusCode is
called once per response. Therefore The tests that interact with
multiple responses now prepare different mock objects for different
responses.
The google-cloud-bigquerystorage 1.12.0 has old gax-httpjson
version 0.78.0, which causes dependency conflicts.
The libraries-bom 20.0.0 has google-cloud-bigquerystorage 1.17.0
but the version has removed a method used in Beam (
apache#14563). Unfortunatley even
1.17.0 does not have compatible version of gax-httpjson.
Therefore, this commit fixes the dependency conflict by declaring
newer gax-httpjson (version from the libraries-bom) on the
sdks/java/io/google-cloud-platform module.
@suztomo
Copy link
Contributor Author

suztomo commented Apr 19, 2021

Run PostCommit_Java_DataflowV2

@suztomo
Copy link
Contributor Author

suztomo commented Apr 19, 2021

Run Java PostCommit

@suztomo
Copy link
Contributor Author

suztomo commented Apr 19, 2021

Run PostCommit_Java_Dataflow

@suztomo
Copy link
Contributor Author

suztomo commented Apr 19, 2021

Run Dataflow ValidatesRunner

@suztomo
Copy link
Contributor Author

suztomo commented Apr 19, 2021

Run SQL Postcommit

@suztomo
Copy link
Contributor Author

suztomo commented Apr 19, 2021

R: @pabloem
Can you review this PR? It's almost same as #14218 but the mock object setup fix included.

@suztomo suztomo requested a review from pabloem April 19, 2021 23:33
@suztomo
Copy link
Contributor Author

suztomo commented Apr 19, 2021

Run PythonDocker PreCommit

@suztomo
Copy link
Contributor Author

suztomo commented Apr 20, 2021

Run Java_Examples_Dataflow PreCommit

@suztomo
Copy link
Contributor Author

suztomo commented Apr 20, 2021

Run Portable_Python PreCommit

@suztomo
Copy link
Contributor Author

suztomo commented Apr 20, 2021

Run PythonDocker PreCommit

@pabloem
Copy link
Member

pabloem commented Apr 20, 2021

Run PostCommit_Java_Dataflow

Copy link
Member

@pabloem pabloem left a comment

Choose a reason for hiding this comment

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

Thanks @suztomo ! LGTM
Let's just make sure that our Java tests are all passing, but feel free to merge after that.

@suztomo
Copy link
Contributor Author

suztomo commented Apr 20, 2021

@pabloem Thank you. All Java tests passed. (Portable_Python and PythonDocker have been failing in pull requests in this repo)

@suztomo suztomo merged commit 62df129 into apache:master Apr 20, 2021
@suztomo suztomo deleted the libraries-bom_20 branch April 20, 2021 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants