-
Notifications
You must be signed in to change notification settings - Fork 85
test: retry conformance tests fixes, round 2 #1040
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: retry conformance tests fixes, round 2 #1040
Conversation
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks good!
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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this end up being necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.