Repository navigation
test(storage): update test_mrd_open_with_read_handle_over_cloud_path for CloudPath read_handle support - #19051
Draft
shradhakatyal wants to merge 1 commit into
Conversation
…for CloudPath read_handle support When opening an AsyncMultiRangeDownloader with an existing read_handle over CLOUD_PATH (attempt_direct_path=False), the GCS backend now honors the read_handle fast-path just as it does over DIRECT_PATH, omitting object metadata in the initial BidiReadObjectResponse and leaving persisted_size as None. [Generated-by: AI]
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Updates
test_mrd_open_with_read_handle_over_cloud_pathinpackages/google-cloud-storage/tests/system/test_rapid.pyto assertassert new_mrd.persisted_size is None(matchingtest_mrd_open_with_read_handleover DirectPath).Why This Is Needed
persisted_sizeIs Populated:In
_AsyncReadObjectStream.open()(packages/google-cloud-storage/google/cloud/storage/asyncio/async_read_object_stream.py),self.persisted_size = response.metadata.sizeis only populated when the server returnsresponse.metadata(Objectproto) in the initialBidiReadObjectResponse.read_handle:When a
BidiReadObjectstream is opened using an existingread_handle(BidiReadObjectSpec.read_handle), the server fast-path skips metadata lookup and omitsresponse.metadatafrom the initial response. Consequently,new_mrd.persisted_sizeremainsNone(as verified intest_mrd_open_with_read_handleover DirectPath).read_handleover CloudPath:Previously,
test_mrd_open_with_read_handle_over_cloud_pathassertedassert new_mrd.persisted_size == len(_BYTES_TO_UPLOAD)because the GCS backend did not supportread_handleoverCLOUD_PATH(attempt_direct_path=False), falling back to a full open that returnedresponse.metadata.The GCS backend now honors
read_handleoverCLOUD_PATHjust likeDIRECT_PATH, omittingresponse.metadataon initial open sonew_mrd.persisted_sizeisNone.[Generated-by: AI]