Skip to content

chore(storage): fix order dependency in get_object_contexts test#34844

Open
aandreassa wants to merge 1 commit into
mainfrom
fix-storage-order-test
Open

chore(storage): fix order dependency in get_object_contexts test#34844
aandreassa wants to merge 1 commit into
mainfrom
fix-storage-order-test

Conversation

@aandreassa

@aandreassa aandreassa commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Currently this fails if the order is incorrect, introducing flakiness:

1) Failure:
Files Snippets::get_object_contexts#test_0001_fetches all object contexts [acceptance/files_test.rb:341]:
In stdout.
--- expected
+++ actual
@@ -1,4 +1,4 @@
 "Custom Contexts for path/file_name_9d512d3ea21775ecf8d953f9f31138f6.txt are:
-Key: my-custom-key, Value: my-custom-value
 Key: my-custom-key-2, Value: my-custom-value-2
+Key: my-custom-key, Value: my-custom-value
 "

Noticed in #34751

chore(storage): pass user_project when resetting requester_pays in samples cleanup

Fixes an order dependency where resetting requester_pays in the after cleanup hook failed
due to a missing user_project parameter, breaking subsequent tests.

Example error:

  1) Error:
Files Snippets#test_0001_list_files:
Google::Cloud::InvalidArgumentError: required: Bucket is a requester pays bucket but no user project provided.
    /workspace/google-cloud-storage/lib/google/cloud/storage/service.rb:1037:in 'Google::Cloud::Storage::Service#execute'
    /workspace/google-cloud-storage/lib/google/cloud/storage/service.rb:167:in 'Google::Cloud::Storage::Service#patch_bucket'
    /workspace/google-cloud-storage/lib/google/cloud/storage/bucket.rb:3467:in 'Google::Cloud::Storage::Bucket#patch_gapi!'
    /workspace/google-cloud-storage/lib/google/cloud/storage/bucket.rb:656:in 'Google::Cloud::Storage::Bucket#requester_pays='
    acceptance/files_test.rb:80:in 'block (2 levels) in <top (required)>'

@aandreassa
aandreassa force-pushed the fix-storage-order-test branch from c7d29af to 6789003 Compare July 16, 2026 22:04
@aandreassa
aandreassa marked this pull request as ready for review July 16, 2026 22:09
@aandreassa
aandreassa requested review from a team and yoshi-approver as code owners July 16, 2026 22:09
@aandreassa aandreassa closed this Jul 16, 2026
@aandreassa aandreassa reopened this Jul 16, 2026
@aandreassa

Copy link
Copy Markdown
Contributor Author

@bajajneha27 or @cpriti-os if I could get a LGTM on this flaky test. TY!

@aandreassa
aandreassa force-pushed the fix-storage-order-test branch from 6789003 to 5a7af6b Compare July 21, 2026 19:05
@aandreassa aandreassa added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 21, 2026
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 21, 2026
@aandreassa
aandreassa force-pushed the fix-storage-order-test branch from 5a7af6b to d2cf3f7 Compare July 21, 2026 21:24
@aandreassa aandreassa added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 22, 2026
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 22, 2026
@aandreassa
aandreassa force-pushed the fix-storage-order-test branch 2 times, most recently from e81aec1 to b3fff72 Compare July 22, 2026 22:38
@aandreassa aandreassa added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 22, 2026
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 22, 2026
@aandreassa
aandreassa force-pushed the fix-storage-order-test branch from b3fff72 to a14539f Compare July 22, 2026 23:32
@aandreassa aandreassa added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 23, 2026
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 23, 2026
@aandreassa
aandreassa force-pushed the fix-storage-order-test branch from a14539f to a64b033 Compare July 23, 2026 00:44
Currently this fails if the order is incorrect:
```
-Key: my-custom-key, Value: my-custom-value
 Key: my-custom-key-2, Value: my-custom-value-2
+Key: my-custom-key, Value: my-custom-value
```

Noticed in #34751
@aandreassa
aandreassa force-pushed the fix-storage-order-test branch from a64b033 to 5b4acf6 Compare July 23, 2026 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants