KEMBAR78
test: retry conformance tests fixes, round 2 by BenWhitehead · Pull Request #1040 · googleapis/java-storage · GitHub
Skip to content

Conversation

@BenWhitehead
Copy link
Collaborator

  • 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
@BenWhitehead BenWhitehead requested a review from a team as a code owner September 22, 2021 22:39
@product-auto-label product-auto-label bot added the api: storage Issues related to the googleapis/java-storage API. label Sep 22, 2021
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Sep 22, 2021
Copy link
Contributor

@tritone tritone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks good!

WritableByteChannel write =
Channels.newChannel(NullOutputStream.INSTANCE);
ByteStreams.copy(reader, write);
} catch (IOException e) {
Copy link
Contributor

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?

Copy link
Collaborator Author

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.

@BenWhitehead BenWhitehead merged commit d6d9545 into googleapis:master Sep 23, 2021
@BenWhitehead BenWhitehead deleted the retry-conformance-tests/fixes-2 branch September 23, 2021 21:02
@BenWhitehead BenWhitehead added this to the Retry Conformance Project milestone Oct 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: storage Issues related to the googleapis/java-storage API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants