Skip to content

Commit 0063aaa

Browse files
committed
test: use grpc_client_direct in AsyncMultiRangeDownloader system tests
1 parent aed8682 commit 0063aaa

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

packages/google-cloud-storage/tests/system/test_zonal.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ async def _run():
598598

599599

600600
def test_mrd_concurrent_download(
601-
storage_client, blobs_to_delete, event_loop, grpc_client
601+
storage_client, blobs_to_delete, event_loop, grpc_client_direct
602602
):
603603
"""
604604
Test that mrd can handle concurrent `download_ranges` calls correctly.
@@ -611,13 +611,13 @@ def test_mrd_concurrent_download(
611611
async def _run():
612612
object_data = os.urandom(object_size)
613613

614-
writer = AsyncAppendableObjectWriter(grpc_client, _ZONAL_BUCKET, object_name)
614+
writer = AsyncAppendableObjectWriter(grpc_client_direct, _ZONAL_BUCKET, object_name)
615615
await writer.open()
616616
await writer.append(object_data)
617617
await writer.close(finalize_on_close=True)
618618

619619
async with AsyncMultiRangeDownloader(
620-
grpc_client, _ZONAL_BUCKET, object_name
620+
grpc_client_direct, _ZONAL_BUCKET, object_name
621621
) as mrd:
622622
tasks = []
623623
ranges_to_fetch = []
@@ -673,7 +673,7 @@ async def _run():
673673

674674

675675
def test_mrd_concurrent_download_cancellation(
676-
storage_client, blobs_to_delete, event_loop, grpc_client
676+
storage_client, blobs_to_delete, event_loop, grpc_client_direct
677677
):
678678
"""
679679
Test task cancellation / abort mid-stream.
@@ -686,13 +686,13 @@ def test_mrd_concurrent_download_cancellation(
686686
async def _run():
687687
object_data = os.urandom(object_size)
688688

689-
writer = AsyncAppendableObjectWriter(grpc_client, _ZONAL_BUCKET, object_name)
689+
writer = AsyncAppendableObjectWriter(grpc_client_direct, _ZONAL_BUCKET, object_name)
690690
await writer.open()
691691
await writer.append(object_data)
692692
await writer.close(finalize_on_close=True)
693693

694694
async with AsyncMultiRangeDownloader(
695-
grpc_client, _ZONAL_BUCKET, object_name
695+
grpc_client_direct, _ZONAL_BUCKET, object_name
696696
) as mrd:
697697
tasks = []
698698
num_chunks = 100
@@ -732,7 +732,7 @@ async def _run():
732732

733733

734734
def test_mrd_concurrent_download_out_of_bounds(
735-
storage_client, blobs_to_delete, event_loop, grpc_client
735+
storage_client, blobs_to_delete, event_loop, grpc_client_direct
736736
):
737737
"""
738738
Test out-of-bounds & edge ranges concurrent with valid requests.
@@ -745,13 +745,13 @@ def test_mrd_concurrent_download_out_of_bounds(
745745
async def _run():
746746
object_data = os.urandom(object_size)
747747

748-
writer = AsyncAppendableObjectWriter(grpc_client, _ZONAL_BUCKET, object_name)
748+
writer = AsyncAppendableObjectWriter(grpc_client_direct, _ZONAL_BUCKET, object_name)
749749
await writer.open()
750750
await writer.append(object_data)
751751
await writer.close(finalize_on_close=True)
752752

753753
async with AsyncMultiRangeDownloader(
754-
grpc_client, _ZONAL_BUCKET, object_name
754+
grpc_client_direct, _ZONAL_BUCKET, object_name
755755
) as mrd:
756756
b_valid = BytesIO()
757757
t_valid = asyncio.create_task(mrd.download_ranges([(0, 100, b_valid)]))

0 commit comments

Comments
 (0)