test: retry conformance tests fixes, round 2#1040
Merged
BenWhitehead merged 7 commits intogoogleapis:masterfrom Sep 23, 2021
BenWhitehead:retry-conformance-tests/fixes-2
Merged
test: retry conformance tests fixes, round 2#1040BenWhitehead merged 7 commits intogoogleapis:masterfrom BenWhitehead:retry-conformance-tests/fixes-2
BenWhitehead merged 7 commits intogoogleapis:masterfrom
BenWhitehead:retry-conformance-tests/fixes-2
Conversation
Collaborator
BenWhitehead
commented
Sep 22, 2021
- test: fix setup for hmacKey create
- test: fix setup for bucket patch
- test: cleanup bucket.lockRetentionPolicy mapping
- Add precondition predicate to mapping with IfMetagenerationMatch and remove mapping with no guard. Metageneration is a required argument.
- test: fix mappings for ReadChannel
- ReadChannel wrap any exceptions in an IOException, and doesn't extract the cause from the RetryHelperException
- test: fix mappings hmacKey.delete
- As part of setup for delete we need to set the key to inactive
- test: individualMapping(int) -> specificMappings(int...)
* Add precondition predicate to mapping with IfMetagenerationMatch and remove mapping with no guard. Metageneration is a required argument.
ReadChannel wrap any exceptions in an IOException, and doesn't extract the cause from the RetryHelperException
As part of setup for delete we need to set the key to inactive
tritone
approved these changes
Sep 22, 2021
google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/CtxFunctions.java
Show resolved
Hide resolved
| WritableByteChannel write = | ||
| Channels.newChannel(NullOutputStream.INSTANCE); | ||
| ByteStreams.copy(reader, write); | ||
| } catch (IOException e) { |
Contributor
There was a problem hiding this comment.
Why does this end up being necessary?
Collaborator
Author
There was a problem hiding this comment.
BlobReadChannel wraps any retry helper exception in an IOException
https://github.com/googleapis/java-storage/blob/master/google-cloud-storage/src/main/java/com/google/cloud/storage/BlobReadChannel.java#L140-L142
We can't change the exception hierarchy without the possibility of breaking customers error handling code, so I opted to unwrap here in the test to get to the actual StorageException/Rpc Exception.
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.