Skip to content

Commit 1e4a4ec

Browse files
jaycee-licopybara-github
authored andcommitted
chore: resolve flaky vertexai system tests
PiperOrigin-RevId: 577908201
1 parent 87dfe40 commit 1e4a4ec

5 files changed

Lines changed: 10 additions & 0 deletions

File tree

tests/system/vertexai/test_bigframes_sklearn.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@
6060
if os.environ.get("KOKORO_GIT_COMMIT")
6161
else "google-cloud-aiplatform[preview,autologging] @ git+https://github.com/googleapis/python-aiplatform.git@main",
6262
)
63+
# To avoid flaky test due to autolog enabled in parallel tests
64+
@mock.patch.object(vertexai.preview.global_config, "autolog", False)
6365
@pytest.mark.usefixtures(
6466
"prepare_staging_bucket", "delete_staging_bucket", "tear_down_resources"
6567
)

tests/system/vertexai/test_bigframes_tensorflow.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@
5656
if os.environ.get("KOKORO_GIT_COMMIT")
5757
else "google-cloud-aiplatform[preview,autologging] @ git+https://github.com/googleapis/python-aiplatform.git@main",
5858
)
59+
# To avoid flaky test due to autolog enabled in parallel tests
60+
@mock.patch.object(vertexai.preview.global_config, "autolog", False)
5961
@pytest.mark.usefixtures(
6062
"prepare_staging_bucket", "delete_staging_bucket", "tear_down_resources"
6163
)

tests/system/vertexai/test_pytorch.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@
4848
if os.environ.get("KOKORO_GIT_COMMIT")
4949
else "google-cloud-aiplatform[preview,autologging] @ git+https://github.com/googleapis/python-aiplatform.git@main",
5050
)
51+
# To avoid flaky test due to autolog enabled in parallel tests
52+
@mock.patch.object(vertexai.preview.global_config, "autolog", False)
5153
@pytest.mark.usefixtures(
5254
"prepare_staging_bucket", "delete_staging_bucket", "tear_down_resources"
5355
)

tests/system/vertexai/test_sklearn.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@
5454
if os.environ.get("KOKORO_GIT_COMMIT")
5555
else "google-cloud-aiplatform[preview,autologging] @ git+https://github.com/googleapis/python-aiplatform.git@main",
5656
)
57+
# To avoid flaky test due to autolog enabled in parallel tests
58+
@mock.patch.object(vertexai.preview.global_config, "autolog", False)
5759
@pytest.mark.usefixtures(
5860
"prepare_staging_bucket", "delete_staging_bucket", "tear_down_resources"
5961
)

tests/system/vertexai/test_tensorflow.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@
5353
if os.environ.get("KOKORO_GIT_COMMIT")
5454
else "google-cloud-aiplatform[preview,autologging] @ git+https://github.com/googleapis/python-aiplatform.git@main",
5555
)
56+
# To avoid flaky test due to autolog enabled in parallel tests
57+
@mock.patch.object(vertexai.preview.global_config, "autolog", False)
5658
@pytest.mark.usefixtures(
5759
"prepare_staging_bucket", "delete_staging_bucket", "tear_down_resources"
5860
)

0 commit comments

Comments
 (0)