Skip to content

Commit 3905271

Browse files
committed
CDRIVER-3535 add test JSON files
1 parent d277e2c commit 3905271

File tree

9 files changed

+1746
-0
lines changed

9 files changed

+1746
-0
lines changed
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
{
2+
"runOn": [
3+
{
4+
"minServerVersion": "4.0",
5+
"topology": [
6+
"replicaset"
7+
]
8+
},
9+
{
10+
"minServerVersion": "4.2",
11+
"topology": [
12+
"sharded"
13+
]
14+
}
15+
],
16+
"database_name": "sdam-tests",
17+
"collection_name": "cancel-server-check",
18+
"data": [],
19+
"tests": [
20+
{
21+
"description": "Cancel server check",
22+
"clientOptions": {
23+
"retryWrites": true,
24+
"heartbeatFrequencyMS": 10000,
25+
"serverSelectionTimeoutMS": 5000,
26+
"appname": "cancelServerCheckTest"
27+
},
28+
"operations": [
29+
{
30+
"name": "insertOne",
31+
"object": "collection",
32+
"arguments": {
33+
"document": {
34+
"_id": 1
35+
}
36+
}
37+
},
38+
{
39+
"name": "configureFailPoint",
40+
"object": "testRunner",
41+
"arguments": {
42+
"failPoint": {
43+
"configureFailPoint": "failCommand",
44+
"mode": {
45+
"times": 1
46+
},
47+
"data": {
48+
"failCommands": [
49+
"insert"
50+
],
51+
"closeConnection": true
52+
}
53+
}
54+
}
55+
},
56+
{
57+
"name": "insertOne",
58+
"object": "collection",
59+
"arguments": {
60+
"document": {
61+
"_id": 2
62+
}
63+
},
64+
"result": {
65+
"insertedId": 2
66+
}
67+
},
68+
{
69+
"name": "waitForEvent",
70+
"object": "testRunner",
71+
"arguments": {
72+
"event": "ServerMarkedUnknownEvent",
73+
"count": 1
74+
}
75+
},
76+
{
77+
"name": "waitForEvent",
78+
"object": "testRunner",
79+
"arguments": {
80+
"event": "PoolClearedEvent",
81+
"count": 1
82+
}
83+
},
84+
{
85+
"name": "insertOne",
86+
"object": "collection",
87+
"arguments": {
88+
"document": {
89+
"_id": 3
90+
}
91+
},
92+
"result": {
93+
"insertedId": 3
94+
}
95+
},
96+
{
97+
"name": "assertEventCount",
98+
"object": "testRunner",
99+
"arguments": {
100+
"event": "ServerMarkedUnknownEvent",
101+
"count": 1
102+
}
103+
},
104+
{
105+
"name": "assertEventCount",
106+
"object": "testRunner",
107+
"arguments": {
108+
"event": "PoolClearedEvent",
109+
"count": 1
110+
}
111+
}
112+
],
113+
"outcome": {
114+
"collection": {
115+
"data": [
116+
{
117+
"_id": 1
118+
},
119+
{
120+
"_id": 2
121+
},
122+
{
123+
"_id": 3
124+
}
125+
]
126+
}
127+
}
128+
}
129+
]
130+
}
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
{
2+
"runOn": [
3+
{
4+
"minServerVersion": "4.4"
5+
}
6+
],
7+
"database_name": "sdam-tests",
8+
"collection_name": "find-network-error",
9+
"data": [
10+
{
11+
"_id": 1
12+
},
13+
{
14+
"_id": 2
15+
}
16+
],
17+
"tests": [
18+
{
19+
"description": "Reset server and pool after network error on find",
20+
"failPoint": {
21+
"configureFailPoint": "failCommand",
22+
"mode": {
23+
"times": 1
24+
},
25+
"data": {
26+
"failCommands": [
27+
"find"
28+
],
29+
"closeConnection": true,
30+
"appName": "findNetworkErrorTest"
31+
}
32+
},
33+
"clientOptions": {
34+
"retryWrites": false,
35+
"retryReads": false,
36+
"appname": "findNetworkErrorTest"
37+
},
38+
"operations": [
39+
{
40+
"name": "find",
41+
"object": "collection",
42+
"arguments": {
43+
"filter": {
44+
"_id": 1
45+
}
46+
},
47+
"error": true
48+
},
49+
{
50+
"name": "waitForEvent",
51+
"object": "testRunner",
52+
"arguments": {
53+
"event": "ServerMarkedUnknownEvent",
54+
"count": 1
55+
}
56+
},
57+
{
58+
"name": "waitForEvent",
59+
"object": "testRunner",
60+
"arguments": {
61+
"event": "PoolClearedEvent",
62+
"count": 1
63+
}
64+
},
65+
{
66+
"name": "insertMany",
67+
"object": "collection",
68+
"arguments": {
69+
"documents": [
70+
{
71+
"_id": 5
72+
},
73+
{
74+
"_id": 6
75+
}
76+
]
77+
}
78+
},
79+
{
80+
"name": "assertEventCount",
81+
"object": "testRunner",
82+
"arguments": {
83+
"event": "ServerMarkedUnknownEvent",
84+
"count": 1
85+
}
86+
},
87+
{
88+
"name": "assertEventCount",
89+
"object": "testRunner",
90+
"arguments": {
91+
"event": "PoolClearedEvent",
92+
"count": 1
93+
}
94+
}
95+
],
96+
"expectations": [
97+
{
98+
"command_started_event": {
99+
"command": {
100+
"find": "find-network-error"
101+
},
102+
"command_name": "find",
103+
"database_name": "sdam-tests"
104+
}
105+
},
106+
{
107+
"command_started_event": {
108+
"command": {
109+
"insert": "find-network-error",
110+
"documents": [
111+
{
112+
"_id": 5
113+
},
114+
{
115+
"_id": 6
116+
}
117+
]
118+
},
119+
"command_name": "insert",
120+
"database_name": "sdam-tests"
121+
}
122+
}
123+
],
124+
"outcome": {
125+
"collection": {
126+
"data": [
127+
{
128+
"_id": 1
129+
},
130+
{
131+
"_id": 2
132+
},
133+
{
134+
"_id": 5
135+
},
136+
{
137+
"_id": 6
138+
}
139+
]
140+
}
141+
}
142+
}
143+
]
144+
}

0 commit comments

Comments
 (0)