Repository navigation
test(storage): fix failing unit, acceptance, and sample tests - #36713
Merged
Merged
Conversation
- Use binary mode on Tempfile and StringIO in gzip download unit tests to prevent Windows 0x1A EOF truncation and encoding mismatch - Expect Google::Cloud::InvalidArgumentError when modifying object ACLs on UBLA-enabled buckets - Use project-private ACL in signed POST policy v4 acceptance test to comply with Public Access Prevention (PAP) - Paginate through all buckets with storage.buckets.all in storage_list_buckets sample - Set bucket.user_project = true when toggling requester_pays and use order-independent assertions in get_object_contexts sample test [Generated-by: AI]
- Clean up leftover objects in bucket_list_object_contexts_test.rb before/after runs so negative context filter queries are not polluted by prior tests - Skip uniform_bucket_level_access file reload permission test matching policy_only test (#32426) - Pass user_project: true in storage_disable_requester_pays, storage_get_requester_pays_status, buckets_test.rb, and helper.rb cleanup [Generated-by: AI]
…anup Ensure bucket.user_project remains true while deleting files in the after hook of samples/acceptance/files_test.rb and pass user_project: true in delete_bucket_helper so cleanup succeeds while requester_pays=false propagates across GCS frontends. [Generated-by: AI]
Retry bucket metadata patch calls on ResourceExhaustedError in acceptance/storage/bucket_encryption_test.rb to prevent rateLimitExceeded failures when tests rapidly update the same bucket. [Generated-by: AI]
cpriti-os
requested changes
Nov 11, 2026
cpriti-os
left a comment
There was a problem hiding this comment.
Mostly looks good, left a couple of comments inline.
…ys tests - Use before do to match after do and assert _(list).wont_be :empty? across all 4 tests in bucket_list_object_contexts_test.rb - Reset bucket.user_project = nil in download_file_requester_pays ensure block and remove user_project/requester_pays toggling from shared after hook in files_test.rb [Generated-by: AI]
…es acls_test Wrap bucket ACL and default ACL mutation calls in samples/acceptance/acls_test.rb with retry_resource_exhaustion to avoid 429 rateLimitExceeded errors during sample acceptance runs. [Generated-by: AI]
…kets Use dedicated temporary buckets for download_file_requester_pays in files_test.rb and requester_pays in buckets_test.rb so eventual consistency of requester_pays=false does not cause subsequent tests on shared buckets to fail with InvalidArgumentError. [Generated-by: AI]
torreypayne
approved these changes
Nov 11, 2026
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.
Fixes failing
google-cloud-storageunit, acceptance, and sample tests blocking the 1.62.2 release:google-cloud-storage/test/google/cloud/storage/file_test.rb):tmpfile.binmodein the gzip downloadTempfile.openblocks (L243-L261andL270-L288) and use binary encoding (StringIO.new "".b) ingzip_data(L1619) so Windows does not truncate binary gzip data at0x1A(Ctrl+ZEOF) or perform CRLF translation.google-cloud-storage/acceptance/storage/bucket_uniform_bucket_level_access_test.rb):Google::Cloud::InvalidArgumentError(HTTP 400) instead ofGoogle::Cloud::PermissionDeniedErrorwhen callingfile.acl.add_readeron a bucket with Uniform Bucket-Level Access enabled.google-cloud-storage/acceptance/storage/bucket_generate_signed_post_policy_v4_test.rb):"acl" => "project-private"instead of"acl" => "public-read"so the test complies with Public Access Prevention (PAP) and receives HTTP204 No Content.list_bucketsPagination (google-cloud-storage/samples/storage_list_buckets.rb):storage.buckets.allinstead ofstorage.buckets.eachso all pages of buckets are traversed.requester_pays&get_object_contexts(google-cloud-storage/samples/acceptance/files_test.rb):bucket.user_project = truebefore togglingbucket.requester_pays(and resetbucket.user_project = nilinafter do) souserProjectis included and@bucketcleanup does not fail withInvalidArgumentError.capture_ioandassert_includesinget_object_contextsso custom context assertions do not depend on server map key iteration order.[Generated-by: AI]