Skip to content

Commit

Permalink
DRIVERS-555 Increase GridFS test timeouts and other fixes for CSOT (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaneHarvey committed Jul 29, 2022
1 parent 10b4a41 commit 3200d46
Show file tree
Hide file tree
Showing 10 changed files with 158 additions and 97 deletions.
41 changes: 28 additions & 13 deletions source/client-side-operations-timeout/tests/gridfs-advanced.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"schemaVersion": "1.9",
"runOnRequirements": [
{
"minServerVersion": "4.4"
"minServerVersion": "4.4",
"serverless": "forbid"
}
],
"createEntities": [
Expand All @@ -17,7 +18,7 @@
"client": {
"id": "client",
"uriOptions": {
"timeoutMS": 50
"timeoutMS": 75
},
"useMultipleMongoses": false,
"observeEvents": [
Expand Down Expand Up @@ -62,13 +63,12 @@
"_id": {
"$oid": "000000000000000000000005"
},
"length": 10,
"length": 8,
"chunkSize": 4,
"uploadDate": {
"$date": "1970-01-01T00:00:00.000Z"
},
"md5": "57d83cd477bfb1ccd975ab33d827a92b",
"filename": "length-10",
"filename": "length-8",
"contentType": "application/octet-stream",
"aliases": [],
"metadata": {}
Expand All @@ -93,6 +93,21 @@
"subType": "00"
}
}
},
{
"_id": {
"$oid": "000000000000000000000006"
},
"files_id": {
"$oid": "000000000000000000000005"
},
"n": 1,
"data": {
"$binary": {
"base64": "ESIzRA==",
"subType": "00"
}
}
}
]
}
Expand All @@ -116,7 +131,7 @@
"update"
],
"blockConnection": true,
"blockTimeMS": 55
"blockTimeMS": 100
}
}
}
Expand All @@ -129,7 +144,7 @@
"$oid": "000000000000000000000005"
},
"newFilename": "foo",
"timeoutMS": 100
"timeoutMS": 2000
}
}
],
Expand Down Expand Up @@ -174,7 +189,7 @@
"update"
],
"blockConnection": true,
"blockTimeMS": 55
"blockTimeMS": 100
}
}
}
Expand Down Expand Up @@ -234,7 +249,7 @@
"drop"
],
"blockConnection": true,
"blockTimeMS": 55
"blockTimeMS": 100
}
}
}
Expand All @@ -243,7 +258,7 @@
"name": "drop",
"object": "bucket",
"arguments": {
"timeoutMS": 100
"timeoutMS": 2000
}
}
]
Expand All @@ -266,7 +281,7 @@
"drop"
],
"blockConnection": true,
"blockTimeMS": 55
"blockTimeMS": 100
}
}
}
Expand Down Expand Up @@ -320,7 +335,7 @@
"drop"
],
"blockConnection": true,
"blockTimeMS": 55
"blockTimeMS": 100
}
}
}
Expand Down Expand Up @@ -352,7 +367,7 @@
"drop"
],
"blockConnection": true,
"blockTimeMS": 30
"blockTimeMS": 50
}
}
}
Expand Down
28 changes: 16 additions & 12 deletions source/client-side-operations-timeout/tests/gridfs-advanced.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ schemaVersion: "1.9"

runOnRequirements:
- minServerVersion: "4.4"
serverless: forbid # GridFS ops can be slow on serverless.

createEntities:
- client:
Expand All @@ -12,7 +13,7 @@ createEntities:
- client:
id: &client client
uriOptions:
timeoutMS: 50
timeoutMS: 75
useMultipleMongoses: false
observeEvents:
- commandStartedEvent
Expand All @@ -37,11 +38,10 @@ initialData:
databaseName: *databaseName
documents:
- _id: &fileDocumentId { $oid: "000000000000000000000005" }
length: 10
length: 8
chunkSize: 4
uploadDate: { $date: "1970-01-01T00:00:00.000Z" }
md5: "57d83cd477bfb1ccd975ab33d827a92b"
filename: "length-10"
filename: "length-8"
contentType: "application/octet-stream"
aliases: []
metadata: {}
Expand All @@ -52,6 +52,10 @@ initialData:
files_id: *fileDocumentId
n: 0
data: { $binary: { base64: "ESIzRA==", subType: "00" } } # hex: 11223344
- _id: { $oid: "000000000000000000000006" }
files_id: *fileDocumentId
n: 1
data: { $binary: { base64: "ESIzRA==", subType: "00" } } # hex: 11223344

tests:
# Tests for the "rename" operation.
Expand All @@ -68,13 +72,13 @@ tests:
data:
failCommands: ["update"]
blockConnection: true
blockTimeMS: 55
blockTimeMS: 100
- name: rename
object: *bucket
arguments:
id: *fileDocumentId
newFilename: "foo"
timeoutMS: 100 # The client timeoutMS is 50 and the operation blocks for 55ms, so 100ms should let it succeed.
timeoutMS: 2000 # The client timeoutMS is 75ms and the operation blocks for 100ms, so 2000ms should let it succeed.
expectEvents:
- client: *client
events:
Expand All @@ -97,7 +101,7 @@ tests:
data:
failCommands: ["update"]
blockConnection: true
blockTimeMS: 55
blockTimeMS: 100
- name: rename
object: *bucket
arguments:
Expand Down Expand Up @@ -130,11 +134,11 @@ tests:
data:
failCommands: ["drop"]
blockConnection: true
blockTimeMS: 55
blockTimeMS: 100
- name: drop
object: *bucket
arguments:
timeoutMS: 100 # The client timeoutMS is 50 and the operation blocks for 55ms, so 100ms should let it succeed.
timeoutMS: 2000 # The client timeoutMS is 75ms and the operation blocks for 100ms, so 2000ms should let it succeed.

- description: "timeoutMS applied to files collection drop"
operations:
Expand All @@ -148,7 +152,7 @@ tests:
data:
failCommands: ["drop"]
blockConnection: true
blockTimeMS: 55
blockTimeMS: 100
- name: drop
object: *bucket
expectError:
Expand Down Expand Up @@ -177,7 +181,7 @@ tests:
data:
failCommands: ["drop"]
blockConnection: true
blockTimeMS: 55
blockTimeMS: 100
- name: drop
object: *bucket
expectError:
Expand All @@ -195,7 +199,7 @@ tests:
data:
failCommands: ["drop"]
blockConnection: true
blockTimeMS: 30
blockTimeMS: 50
- name: drop
object: *bucket
expectError:
Expand Down
35 changes: 25 additions & 10 deletions source/client-side-operations-timeout/tests/gridfs-delete.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"schemaVersion": "1.9",
"runOnRequirements": [
{
"minServerVersion": "4.4"
"minServerVersion": "4.4",
"serverless": "forbid"
}
],
"createEntities": [
Expand All @@ -17,7 +18,7 @@
"client": {
"id": "client",
"uriOptions": {
"timeoutMS": 50
"timeoutMS": 75
},
"useMultipleMongoses": false,
"observeEvents": [
Expand Down Expand Up @@ -62,13 +63,12 @@
"_id": {
"$oid": "000000000000000000000005"
},
"length": 10,
"length": 8,
"chunkSize": 4,
"uploadDate": {
"$date": "1970-01-01T00:00:00.000Z"
},
"md5": "57d83cd477bfb1ccd975ab33d827a92b",
"filename": "length-10",
"filename": "length-8",
"contentType": "application/octet-stream",
"aliases": [],
"metadata": {}
Expand All @@ -93,6 +93,21 @@
"subType": "00"
}
}
},
{
"_id": {
"$oid": "000000000000000000000006"
},
"files_id": {
"$oid": "000000000000000000000005"
},
"n": 1,
"data": {
"$binary": {
"base64": "ESIzRA==",
"subType": "00"
}
}
}
]
}
Expand All @@ -116,7 +131,7 @@
"delete"
],
"blockConnection": true,
"blockTimeMS": 55
"blockTimeMS": 100
}
}
}
Expand All @@ -128,7 +143,7 @@
"id": {
"$oid": "000000000000000000000005"
},
"timeoutMS": 100
"timeoutMS": 1000
}
}
]
Expand All @@ -151,7 +166,7 @@
"delete"
],
"blockConnection": true,
"blockTimeMS": 55
"blockTimeMS": 100
}
}
}
Expand Down Expand Up @@ -210,7 +225,7 @@
"delete"
],
"blockConnection": true,
"blockTimeMS": 55
"blockTimeMS": 100
}
}
}
Expand Down Expand Up @@ -247,7 +262,7 @@
"delete"
],
"blockConnection": true,
"blockTimeMS": 30
"blockTimeMS": 50
}
}
}
Expand Down

0 comments on commit 3200d46

Please sign in to comment.