You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "akashorabek (via GitHub)" <gi...@apache.org> on 2025/04/03 11:13:14 UTC
[PR] Fix postcommit python flaky tests [beam]
akashorabek opened a new pull request, #34536:
URL: https://github.com/apache/beam/pull/34536
Addresses: [#30513](https://github.com/apache/beam/issues/30513)
Fixes the main frequently occurring flaky tests in the PostCommit Python workflow.
Successful job example: https://github.com/akashorabek/beam/actions/runs/14228735266
------------------------
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
- [ ] Mention the appropriate issue in your description (for example: `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, comment `fixes #<ISSUE NUMBER>` instead.
- [ ] Update `CHANGES.md` with noteworthy changes.
- [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
See the [Contributor Guide](https://beam.apache.org/contribute) for more tips on [how to make review process smoother](https://github.com/apache/beam/blob/master/CONTRIBUTING.md#make-the-reviewers-job-easier).
To check the build health, please visit [https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md](https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md)
GitHub Actions Tests Status (on master branch)
------------------------------------------------------------------------------------------------
[](https://github.com/apache/beam/actions?query=workflow%3A%22Build+python+source+distribution+and+wheels%22+branch%3Amaster+event%3Aschedule)
[](https://github.com/apache/beam/actions?query=workflow%3A%22Python+Tests%22+branch%3Amaster+event%3Aschedule)
[](https://github.com/apache/beam/actions?query=workflow%3A%22Java+Tests%22+branch%3Amaster+event%3Aschedule)
[](https://github.com/apache/beam/actions?query=workflow%3A%22Go+tests%22+branch%3Amaster+event%3Aschedule)
See [CI.md](https://github.com/apache/beam/blob/master/CI.md) for more information about GitHub Actions CI or the [workflows README](https://github.com/apache/beam/blob/master/.github/workflows/README.md) to see a list of phrases to trigger workflows.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix postcommit python flaky tests [beam]
Posted by "akashorabek (via GitHub)" <gi...@apache.org>.
akashorabek commented on code in PR #34536:
URL: https://github.com/apache/beam/pull/34536#discussion_r2030612073
##########
sdks/python/apache_beam/io/gcp/bigquery_read_it_test.py:
##########
@@ -674,6 +676,7 @@ def create_table(cls, table_name):
cls.bigquery_client.insert_rows(
cls.project, cls.dataset_id, table_name, table_data)
+ mod_time.sleep(10)
Review Comment:
Replaced to `get_table` method
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix postcommit python flaky tests [beam]
Posted by "akashorabek (via GitHub)" <gi...@apache.org>.
akashorabek commented on code in PR #34536:
URL: https://github.com/apache/beam/pull/34536#discussion_r2030611162
##########
sdks/python/apache_beam/io/gcp/big_query_query_to_table_it_test.py:
##########
@@ -131,6 +131,10 @@ def _setup_new_types_env(self):
request = bigquery.BigqueryTablesInsertRequest(
projectId=self.project, datasetId=self.dataset_id, table=table)
self.bigquery_client.client.tables.Insert(request)
+
+ # Wait for table creation to propagate.
+ time.sleep(10)
Review Comment:
Replaced it with the `get_table` method, which waits and retries until the table becomes visible.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix postcommit python flaky tests [beam]
Posted by "akashorabek (via GitHub)" <gi...@apache.org>.
akashorabek commented on code in PR #34536:
URL: https://github.com/apache/beam/pull/34536#discussion_r2030612073
##########
sdks/python/apache_beam/io/gcp/bigquery_read_it_test.py:
##########
@@ -674,6 +676,7 @@ def create_table(cls, table_name):
cls.bigquery_client.insert_rows(
cls.project, cls.dataset_id, table_name, table_data)
+ mod_time.sleep(10)
Review Comment:
Replaced with `get_table` method
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix postcommit python flaky tests [beam]
Posted by "akashorabek (via GitHub)" <gi...@apache.org>.
akashorabek commented on code in PR #34536:
URL: https://github.com/apache/beam/pull/34536#discussion_r2030607893
##########
sdks/python/apache_beam/ml/gcp/recommendations_ai.py:
##########
@@ -154,13 +155,19 @@ def process(self, element):
request = recommendationengine.CreateCatalogItemRequest(
parent=self.parent, catalog_item=catalog_item)
- try:
- created_catalog_item = self._client.create_catalog_item(
+ @tenacity.retry(
Review Comment:
Done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix postcommit python flaky tests [beam]
Posted by "liferoad (via GitHub)" <gi...@apache.org>.
liferoad commented on code in PR #34536:
URL: https://github.com/apache/beam/pull/34536#discussion_r2027059080
##########
sdks/python/apache_beam/io/gcp/big_query_query_to_table_it_test.py:
##########
@@ -131,6 +131,10 @@ def _setup_new_types_env(self):
request = bigquery.BigqueryTablesInsertRequest(
projectId=self.project, datasetId=self.dataset_id, table=table)
self.bigquery_client.client.tables.Insert(request)
+
+ # Wait for table creation to propagate.
+ time.sleep(10)
Review Comment:
possible to check the table exists?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix postcommit python flaky tests [beam]
Posted by "liferoad (via GitHub)" <gi...@apache.org>.
liferoad commented on code in PR #34536:
URL: https://github.com/apache/beam/pull/34536#discussion_r2027060139
##########
sdks/python/apache_beam/io/gcp/bigquery_read_it_test.py:
##########
@@ -674,6 +676,7 @@ def create_table(cls, table_name):
cls.bigquery_client.insert_rows(
cls.project, cls.dataset_id, table_name, table_data)
+ mod_time.sleep(10)
Review Comment:
if we have to wait, can we move this 10 seconds to a global variable?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix postcommit python flaky tests [beam]
Posted by "liferoad (via GitHub)" <gi...@apache.org>.
liferoad merged PR #34536:
URL: https://github.com/apache/beam/pull/34536
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix postcommit python flaky tests [beam]
Posted by "liferoad (via GitHub)" <gi...@apache.org>.
liferoad commented on code in PR #34536:
URL: https://github.com/apache/beam/pull/34536#discussion_r2027058447
##########
sdks/python/apache_beam/ml/gcp/recommendations_ai.py:
##########
@@ -154,13 +155,19 @@ def process(self, element):
request = recommendationengine.CreateCatalogItemRequest(
parent=self.parent, catalog_item=catalog_item)
- try:
- created_catalog_item = self._client.create_catalog_item(
+ @tenacity.retry(
Review Comment:
shall we keep using our own with_exponential_backoff? cc @damccorm
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix postcommit python flaky tests [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #34536:
URL: https://github.com/apache/beam/pull/34536#issuecomment-2775827901
Assigning reviewers. If you would like to opt out of this review, comment `assign to next reviewer`:
R: @liferoad for label python.
Available commands:
- `stop reviewer notifications` - opt out of the automated review tooling
- `remind me after tests pass` - tag the comment author after tests pass
- `waiting on author` - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)
The PR bot will only process comments in the main thread (not review comments).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix postcommit python flaky tests [beam]
Posted by "akashorabek (via GitHub)" <gi...@apache.org>.
akashorabek commented on code in PR #34536:
URL: https://github.com/apache/beam/pull/34536#discussion_r2030611162
##########
sdks/python/apache_beam/io/gcp/big_query_query_to_table_it_test.py:
##########
@@ -131,6 +131,10 @@ def _setup_new_types_env(self):
request = bigquery.BigqueryTablesInsertRequest(
projectId=self.project, datasetId=self.dataset_id, table=table)
self.bigquery_client.client.tables.Insert(request)
+
+ # Wait for table creation to propagate.
+ time.sleep(10)
Review Comment:
Replaced it with the `get_table` method, which waits and retries until the table becomes visible or throws an error
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org