From 3b9b6ed00386fa43cc6577745a61bba62d69622e Mon Sep 17 00:00:00 2001 From: liferoad Date: Fri, 24 May 2024 18:33:02 -0400 Subject: [PATCH] =?UTF-8?q?added=20pytest.mark.flaky=20for=20test=5Fbig=5F?= =?UTF-8?q?query=5Fwrite=5Ftemp=5Ftable=5Fappend=5Fsc=E2=80=A6=20(#31364)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * added pytest.mark.flaky for test_big_query_write_temp_table_append_schema_update * updated the version * only run flaky when it is available * switched to tenacity * fixed the isort --- sdks/python/apache_beam/io/gcp/bigquery_write_it_test.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sdks/python/apache_beam/io/gcp/bigquery_write_it_test.py b/sdks/python/apache_beam/io/gcp/bigquery_write_it_test.py index 4b728fe7ec1f..4c8e8ebf489a 100644 --- a/sdks/python/apache_beam/io/gcp/bigquery_write_it_test.py +++ b/sdks/python/apache_beam/io/gcp/bigquery_write_it_test.py @@ -34,6 +34,8 @@ import pytz from parameterized import param from parameterized import parameterized +from tenacity import retry +from tenacity import stop_after_attempt import apache_beam as beam from apache_beam.io.gcp.bigquery import BigQueryWriteFn @@ -457,7 +459,7 @@ def test_big_query_write_insert_errors_reporting(self): @pytest.mark.it_postcommit def test_big_query_write_insert_non_transient_api_call_error(self): """ - Test that non-transient GoogleAPICallError errors returned + Test that non-transient GoogleAPICallError errors returned by beam.io.WriteToBigQuery are not retried and result in FAILED_ROWS containing both the failed rows and the reason for failure. @@ -504,6 +506,7 @@ def test_big_query_write_insert_non_transient_api_call_error(self): equal_to(bq_result_errors)) @pytest.mark.it_postcommit + @retry(reraise=True, stop=stop_after_attempt(3)) @parameterized.expand([ param(file_format=FileFormat.AVRO), param(file_format=FileFormat.JSON),