Skip to content

Conversation

@chandra-siri
Copy link
Collaborator

@chandra-siri chandra-siri commented Jan 21, 2026

refactor: move system tests to single event loop.

  • Without this more adding more tests were "shaky" , some of them crashed due to segmentation fault in underlying gRPC's c layer.

@product-auto-label product-auto-label bot added size: l Pull request size is large. api: storage Issues related to the googleapis/python-storage API. labels Jan 21, 2026
@chandra-siri chandra-siri marked this pull request as ready for review January 21, 2026 16:19
@chandra-siri chandra-siri requested review from a team as code owners January 21, 2026 16:19
@chandra-siri chandra-siri changed the title chore: move system tests to single event loop refactor: move system tests to single event loop Jan 22, 2026
@chandra-siri chandra-siri merged commit f751f1e into main Jan 22, 2026
18 checks passed
@chandra-siri chandra-siri deleted the single_event_loop branch January 22, 2026 05:59
Copy link
Collaborator

@jasha26 jasha26 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be not in this PR, but i guess we should refactor this file as there is a lot of duplication. I suggest following

  1. Create a fixture that handles both the generation of a unique object_name and its subsequent cleanup. This removes the need to manually append to blobs_to_delete and call gc.collect() in every test. We do this almost in every test here
  2. Instead of defining a nested async def _run() and calling run_until_complete in every function, create a module-level helper or a fixture that accepts a coroutine.
  3. Can we implement context manager for reader and writer so we can simplify the usage like below:
async with AsyncAppendableObjectWriter(client, bucket, name) as writer:
await writer.append(data)
  1. [Optional]: Since many tests switch between grpc_client and grpc_client_direct, the existing grpc_clients fixture is already a good step. To further reduce code, you can use a fixture that automatically selects the client based on a test parameter (e.g., attempt_direct_path).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: storage Issues related to the googleapis/python-storage API. size: l Pull request size is large.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants