Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion tests/system/aiplatform/e2e_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ def delete_staging_bucket(self, shared_state: Dict[str, Any]):

# Get the staging bucket used for testing and wipe it
bucket = shared_state["bucket"]
bucket.delete(force=True)
bucket.delete_blobs(bucket.list_blobs())
bucket.delete()

@pytest.fixture(scope="class")
def prepare_bigquery_dataset(
Expand Down
8 changes: 7 additions & 1 deletion tests/system/aiplatform/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import uuid
import pytest
import importlib
import logging

import pandas as pd
import re
Expand Down Expand Up @@ -162,7 +163,12 @@ def staging_bucket(self, storage_client):

yield bucket

bucket.delete(force=True)
try:
blobs = list(bucket.list_blobs())
bucket.delete_blobs(blobs)
bucket.delete()
except Exception as e:
logging.exception(f"Failed to cleanup bucket {new_staging_bucket}: {e}")

@pytest.fixture()
def dataset_gapic_client(self):
Expand Down
7 changes: 7 additions & 0 deletions tests/system/aiplatform/test_model_evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@ def staging_bucket(self, storage_client):

yield bucket

try:
blobs = list(bucket.list_blobs())
bucket.delete_blobs(blobs)
bucket.delete()
except Exception as e:
_LOGGER.info(f"Failed to delete bucket {new_staging_bucket}: {e}")

def test_model_evaluate_custom_tabular_model(self, staging_bucket, shared_state):
credentials, _ = auth.default(
scopes=["https://www.googleapis.com/auth/cloud-platform"]
Expand Down
1 change: 1 addition & 0 deletions tests/system/aiplatform/test_model_monitoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ def test_mdm_two_models_one_valid_config(self, shared_state):
location=e2e_base._LOCATION,
endpoint=self.endpoint,
)
shared_state["resources"].append(job)

gapic_job = job._gca_resource
assert (
Expand Down
Loading