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-11797] Fix wrong assertion usage #14377

Merged
merged 1 commit into from Mar 30, 2021
Merged

Conversation

KevinGG
Copy link
Contributor

@KevinGG KevinGG commented Mar 30, 2021

  1. Replaced all assert_called_with with assert_any_call in the
    ProgressIndicatorTest.
  2. assert_called_with only asserts the most recent call. However, there
    is an IPythonLogHandler we have customized to emit rich logging in
    notebooks that also calls display to render HTML and JavaScript. The
    emission of logs can happen any time during the test, causing the
    flakiness. Instead of unregistering the log handler during tests that
    could make the tests unnecessarily complicated, we could use
    assert_any_call within the patched context for simplicity.

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 ---
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 --- --- --- ---

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.

1. Replaced all assert_called_with with assert_any_call in the
   ProgressIndicatorTest.
2. assert_called_with only asserts the most recent call. However, there
   is an IPythonLogHandler we have customized to emit rich logging in
   notebooks that also calls display to render HTML and JavaScript. The
   emission of logs can happen any time during the test, causing the
   flakiness. Instead of unregistering the log handler during tests that
   could make the tests unnecessarily complicated, we could use
   assert_any_call within the patched context for simplicity.
@KevinGG
Copy link
Contributor Author

KevinGG commented Mar 30, 2021

R: @tvalentyn
PTAL, thx!

@codecov
Copy link

codecov bot commented Mar 30, 2021

Codecov Report

Merging #14377 (492dcba) into master (bae76b0) will increase coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #14377      +/-   ##
==========================================
  Coverage   83.41%   83.42%              
==========================================
  Files         938      469     -469     
  Lines      117474    58770   -58704     
==========================================
- Hits        97991    49028   -48963     
+ Misses      19483     9742    -9741     
Impacted Files Coverage Δ
...am/examples/snippets/transforms/elementwise/map.py
...cs/sdks/python/apache_beam/internal/http_client.py
...sdks/python/apache_beam/runners/direct/__init__.py
...srcs/sdks/python/apache_beam/coders/avro_record.py
...on/apache_beam/io/gcp/bigquery_io_read_pipeline.py
...che_beam/examples/flink/flink_streaming_impulse.py
...examples/snippets/transforms/elementwise/values.py
.../srcs/sdks/python/apache_beam/io/gcp/bigtableio.py
...ive/messaging/interactive_environment_inspector.py
.../sdks/python/apache_beam/io/external/gcp/pubsub.py
... and 1397 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 956c7bd...492dcba. Read the comment docs.

@tvalentyn
Copy link
Contributor

Thanks, @KevinGG !

@KevinGG
Copy link
Contributor Author

KevinGG commented Mar 30, 2021

Run PythonDocker PreCommit

@tvalentyn tvalentyn merged commit 52c3b0b into apache:master Mar 30, 2021
@KevinGG KevinGG deleted the BEAM-11797 branch April 5, 2021 21:06
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

2 participants