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
Add RetryingClientEncryption and use it in one prose test #1365
base: master
Are you sure you want to change the base?
Conversation
The intention is to reduce CI flakiness by retrying ClientEncryption operations that are known to fail occasionally in CI due to transient KMS errors.
} | ||
|
||
@Override | ||
public ClientEncryption getClientEncryption(final ClientEncryptionSettings settings) { |
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.
This is actually a bug in the test, as this should be creating a reactive ClientEncryption and wrapping it in a SyncClientEncryption.
|
||
public class ClientEncryptionRewrapManyDataKeyProseTest extends AbstractClientEncryptionRewrapManyDataKeyProseTest { | ||
|
||
@Override | ||
protected MongoClient createMongoClient(final MongoClientSettings settings) { |
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.
Never actually used, so removed it.
@AfterEach | ||
void cleanUp(){ | ||
getMongoClient().getDatabase("keyvault").getCollection("datakeys").drop(); |
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.
No need to drop on cleanup, since we drop on setup.
} | ||
|
||
@Test | ||
public void shouldThrowClientErrorWhenProviderIsNotSpecified() { | ||
//given | ||
ClientEncryption clientEncryption = getClientEncryption(ClientEncryptionSettings.builder() |
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.
Now created in setup. But we don't want to wrap with RetryingClientEncryption because we are actually testing that the operation throws an exception.
BsonDocument srcKey = MASTER_KEYS_BY_PROVIDER.get(srcProvider); | ||
BsonDocument dstKey = MASTER_KEYS_BY_PROVIDER.get(dstProvider); | ||
BsonString testString = new BsonString("test"); | ||
|
||
getMongoClient().getDatabase("keyvault").getCollection("datakeys").drop(); |
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.
Moved to setup
testString, | ||
new EncryptOptions("AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic").keyId(keyId)); | ||
|
||
ClientEncryption clientEncryption2 = getClientEncryption(ClientEncryptionSettings.builder() |
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.
These two ClientEncryption instances are identical. Is there any actual need to have two of them?
The intention is to reduce CI flakiness by retrying ClientEncryption operations that are known to fail occasionally in CI due to transient KMS errors.