Skip to content

Commit

Permalink
testing(sample): fix broken tests (#108)
Browse files Browse the repository at this point in the history
* testing(sample): fix broken tests

fixes #104
fixes #105

* explicitly specify the project id on bucket creation

longer timeout
  • Loading branch information
Takashi Matsuo authored and dandhlee committed Nov 29, 2022
1 parent 6d627f9 commit 2b3bc84
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@

@pytest.fixture(scope="module")
def storage_client():
yield storage.Client()
yield storage.Client(project=PROJECT)


@pytest.fixture(scope="module")
def asset_bucket(storage_client):
bucket = storage_client.create_bucket(BUCKET)
bucket = storage_client.create_bucket(BUCKET, project=PROJECT)

yield BUCKET

Expand All @@ -52,7 +52,7 @@ def test_batch_get_assets_history(asset_bucket, capsys):
bucket_asset_name,
]

@backoff.on_exception(backoff.expo, (AssertionError, InvalidArgument), max_time=30)
@backoff.on_exception(backoff.expo, (AssertionError, InvalidArgument), max_time=60)
def eventually_consistent_test():
quickstart_batchgetassetshistory.batch_get_assets_history(PROJECT, asset_names)
out, _ = capsys.readouterr()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def test_search_all_resources(asset_dataset, capsys):

# Dataset creation takes some time to propagate, so the dataset is not
# immediately searchable. Need some time before the snippet will pass.
@backoff.on_exception(backoff.expo, (AssertionError), max_time=120)
@backoff.on_exception(backoff.expo, (AssertionError), max_time=240)
def eventually_consistent_test():
quickstart_searchallresources.search_all_resources(scope, query=query)
out, _ = capsys.readouterr()
Expand Down

0 comments on commit 2b3bc84

Please sign in to comment.