1+ runOn :
2+ - minServerVersion : " 4.4"
3+ database_name : &database_name "cse-timeouts-db"
4+ collection_name : &collection_name "cse-timeouts-coll"
5+
6+ data : []
7+ json_schema : {'properties': {'encrypted_w_altname': {'encrypt': {'keyId': '/altname', 'bsonType': 'string', 'algorithm': 'AEAD_AES_256_CBC_HMAC_SHA_512-Random'}}, 'encrypted_string': {'encrypt': {'keyId': [{'$binary': {'base64': 'AAAAAAAAAAAAAAAAAAAAAA==', 'subType': '04'}}], 'bsonType': 'string', 'algorithm': 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic'}}, 'random': {'encrypt': {'keyId': [{'$binary': {'base64': 'AAAAAAAAAAAAAAAAAAAAAA==', 'subType': '04'}}], 'bsonType': 'string', 'algorithm': 'AEAD_AES_256_CBC_HMAC_SHA_512-Random'}}, 'encrypted_string_equivalent': {'encrypt': {'keyId': [{'$binary': {'base64': 'AAAAAAAAAAAAAAAAAAAAAA==', 'subType': '04'}}], 'bsonType': 'string', 'algorithm': 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic'}}}, 'bsonType': 'object'}
8+ key_vault_data : [{'status': 1, '_id': {'$binary': {'base64': 'AAAAAAAAAAAAAAAAAAAAAA==', 'subType': '04'}}, 'masterKey': {'provider': 'aws', 'key': 'arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0', 'region': 'us-east-1'}, 'updateDate': {'$date': {'$numberLong': '1552949630483'}}, 'keyMaterial': {'$binary': {'base64': 'AQICAHhQNmWG2CzOm1dq3kWLM+iDUZhEqnhJwH9wZVpuZ94A8gEqnsxXlR51T5EbEVezUqqKAAAAwjCBvwYJKoZIhvcNAQcGoIGxMIGuAgEAMIGoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDHa4jo6yp0Z18KgbUgIBEIB74sKxWtV8/YHje5lv5THTl0HIbhSwM6EqRlmBiFFatmEWaeMk4tO4xBX65eq670I5TWPSLMzpp8ncGHMmvHqRajNBnmFtbYxN3E3/WjxmdbOOe+OXpnGJPcGsftc7cB2shRfA4lICPnE26+oVNXT6p0Lo20nY5XC7jyCO', 'subType': '00'}}, 'creationDate': {'$date': {'$numberLong': '1552949630483'}}, 'keyAltNames': ['altname', 'another_altname']}]
9+
10+ tests :
11+ - description : " timeoutMS applied to listCollections to get collection schema"
12+ failPoint :
13+ configureFailPoint : failCommand
14+ mode : { times: 1 }
15+ data :
16+ failCommands : ["listCollections"]
17+ blockConnection : true
18+ blockTimeMS : 60
19+ clientOptions :
20+ autoEncryptOpts :
21+ kmsProviders :
22+ aws : {} # Credentials filled in from environment.
23+ timeoutMS : 50
24+ operations :
25+ - name : insertOne
26+ arguments :
27+ document : &doc0 { _id: 1, encrypted_string: "string0", random: "abc" }
28+ result :
29+ isTimeoutError : true
30+ expectations :
31+ # Auto encryption will request the collection info.
32+ - command_started_event :
33+ command :
34+ listCollections : 1
35+ filter :
36+ name : *collection_name
37+ maxTimeMS : { $$type: ["int", "long"] }
38+ command_name : listCollections
39+
40+ # Test that timeoutMS applies to the sum of all operations done for client-side encryption. This is done by blocking
41+ # listCollections and find for 30ms each and running an insertOne with timeoutMS=50. There should be one
42+ # listCollections command and one "find" command, so the sum should take more than timeoutMS. A second listCollections
43+ # event doesn't occur due to the internal MongoClient lacking configured auto encryption, plus libmongocrypt holds the
44+ # collection schema in cache for a minute.
45+ #
46+ # This test does not include command monitoring expectations because the exact command sequence is dependent on the
47+ # amount of time taken by mongocryptd communication. In slow runs, mongocryptd communication can breach the timeout
48+ # and result in the final "find" not being sent.
49+ - description : " remaining timeoutMS applied to find to get keyvault data"
50+ failPoint :
51+ configureFailPoint : failCommand
52+ mode : { times: 2 }
53+ data :
54+ failCommands : ["listCollections", "find"]
55+ blockConnection : true
56+ blockTimeMS : 30
57+ clientOptions :
58+ autoEncryptOpts :
59+ kmsProviders :
60+ aws : {} # Credentials filled in from environment.
61+ timeoutMS : 50
62+ operations :
63+ - name : insertOne
64+ arguments :
65+ document : *doc0
66+ result :
67+ isTimeoutError : true
0 commit comments