-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Fix gRPC failures in Python PreCommit tests #37350
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
base: master
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @aIbrahiim, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses gRPC failures in Python PreCommit tests by standardizing the pipeline runner used within various test cases. By explicitly setting the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
@damccorm could you please review this? |
|
Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment |
|
Assigning reviewers: R: @tvalentyn for label python. Note: If you would like to opt out of this review, comment Available commands:
The PR bot will only process comments in the main thread (not review comments). |
| mock.patch('time.sleep'), \ | ||
| self.assertRaises(Exception) as exc,\ | ||
| beam.Pipeline() as p: | ||
| beam.Pipeline(runner='DirectRunner') as p: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the value for runner if we don't set runner explicitly in these tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the default runner is supposed to be DirectRunner but the tests were mysteriously using a grpc based runner (FnApiRunner/PortableRunner) in the CI environment, which caused the DEADLINE_EXCEEDED errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally, a DirectRunner is a runner that executes the pipeline locally. We have multiple implementations of DirectRunner, see https://github.com/apache/beam/blob/600bd612dc2ef495fef08675398361159f7a03df/sdks/python/apache_beam/runners/direct/direct_runner.py.
The DirectRunner should already be a default (when a runner is not explicitly specified). However, which implementation is used, should be defined by the logic in direct_runner.py.
Originally, it should be set to 'SwitchingDirectRunner' , meaning that an underlying implementation will be defined based on which DirectRunner implementation supports the pipeline.
| DirectRunner = SwitchingDirectRunner |
The BundleBasedDirect Runner is the oldest implementation and is expected to be used the least. I think these days we should be using either the FnAPI runner or the PrismRunner.
grpc errors is a problem that we have in the FnAPI runner, and possibly also in the PrismRunner - I am not sure. But ultimately, both FnAPI runner and PrismRunner use grpc and we need to find a way how to use these runners in our test suites without grpc flakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would try to look at the following:
-
which runner is selected when we don't specify 'runner' parameter explicitly, and why (b/c it is not a good state to have unsolved mysteries). I didn't expect the setting
runner=DirectRunnerto have an effect. -
does prism runner support these tests? if so, why it is not being used.
-
we might still have to solve the core problem of tuning grpc for our test suites, i don't think switching to bundlebased direct runner is a viable option long term.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh ok, I now understand that DirectRunner = SwitchingDirectRunner which automatically selects PrismRunner which FnApiRunner which BundleBasedDirectRunner based on pipeline compatibility so since both PrismRunner and FnApiRunner use grpc the timeout errors are expected behavior with the current configuration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I agree with Valentyn. There are some tests which pin to the FnApiRunner (e.g.
| with beam.Pipeline('FnApiRunner', options=pipeline_options) as p: |
|
drive-by comment: to request a review from a specific person, use R: <@ username>, otherwise bot will auto-assign - using a bot is also ok if a specific reviewer is not required. |
4f9eb84 to
0260394
Compare
Fixes: #34739
Successful run: https://github.com/aIbrahiim/beam/actions/runs/21150810363
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, commentfixes #<ISSUE NUMBER>instead.CHANGES.mdwith noteworthy changes.See the Contributor Guide for more tips on how to make review process smoother.
To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md
GitHub Actions Tests Status (on master branch)
See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.