Skip to content

Commit 24b8128

Browse files
committed
GODRIVER-4023 Fix CSOT spec test failures on 9.0+ sharded.
1 parent 7bcfafd commit 24b8128

3 files changed

Lines changed: 176 additions & 0 deletions

File tree

internal/integration/unified/testrunner_operation.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,8 @@ func executeTestRunnerOperation(ctx context.Context, op *operation, loopDone <-c
280280
defer cancel()
281281

282282
return waitForEvent(wfeCtx, wfeArgs)
283+
case "advanceConfigClusterTime":
284+
return mtest.AdvanceConfigClusterTime(context.Background())
283285
default:
284286
return fmt.Errorf("unrecognized testRunner operation %q", op.Name)
285287
}

internal/integration/unified/unified_spec_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ var (
4040
"client-backpressure/tests",
4141
"transactions/tests/unified",
4242
"causal-consistency/tests",
43+
// TODO: Comment.
44+
"../../csot-modified",
4345
}
4446
failDirectories = []string{
4547
"unified-test-format/tests/valid-fail",
Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
{
2+
"description": "timeoutMS behaves correctly for change streams",
3+
"schemaVersion": "1.9",
4+
"runOnRequirements": [
5+
{
6+
"minServerVersion": "9.0",
7+
"topologies": [
8+
"sharded"
9+
]
10+
}
11+
],
12+
"createEntities": [
13+
{
14+
"client": {
15+
"id": "failPointClient",
16+
"useMultipleMongoses": false
17+
}
18+
},
19+
{
20+
"client": {
21+
"id": "client",
22+
"useMultipleMongoses": false,
23+
"observeEvents": [
24+
"commandStartedEvent"
25+
],
26+
"ignoreCommandMonitoringEvents": [
27+
"killCursors"
28+
]
29+
}
30+
},
31+
{
32+
"database": {
33+
"id": "database",
34+
"client": "client",
35+
"databaseName": "test"
36+
}
37+
},
38+
{
39+
"collection": {
40+
"id": "collection",
41+
"database": "database",
42+
"collectionName": "coll"
43+
}
44+
}
45+
],
46+
"initialData": [
47+
{
48+
"collectionName": "coll",
49+
"databaseName": "test",
50+
"documents": []
51+
}
52+
],
53+
"tests": [
54+
{
55+
"description": "change stream can be iterated again if previous iteration times out",
56+
"operations": [
57+
{
58+
"name": "advanceConfigClusterTime",
59+
"object": "testRunner"
60+
},
61+
{
62+
"name": "createChangeStream",
63+
"object": "collection",
64+
"arguments": {
65+
"pipeline": [],
66+
"maxAwaitTimeMS": 1,
67+
"timeoutMS": 200
68+
},
69+
"saveResultAsEntity": "changeStream"
70+
},
71+
{
72+
"name": "failPoint",
73+
"object": "testRunner",
74+
"arguments": {
75+
"client": "failPointClient",
76+
"failPoint": {
77+
"configureFailPoint": "failCommand",
78+
"mode": {
79+
"times": 1
80+
},
81+
"data": {
82+
"failCommands": [
83+
"getMore"
84+
],
85+
"blockConnection": true,
86+
"blockTimeMS": 250
87+
}
88+
}
89+
}
90+
},
91+
{
92+
"name": "iterateUntilDocumentOrError",
93+
"object": "changeStream",
94+
"expectError": {
95+
"isTimeoutError": true
96+
}
97+
},
98+
{
99+
"name": "iterateOnce",
100+
"object": "changeStream"
101+
}
102+
],
103+
"expectEvents": [
104+
{
105+
"client": "client",
106+
"events": [
107+
{
108+
"commandStartedEvent": {
109+
"commandName": "aggregate",
110+
"databaseName": "test",
111+
"command": {
112+
"aggregate": "coll",
113+
"maxTimeMS": {
114+
"$$type": [
115+
"int",
116+
"long"
117+
]
118+
}
119+
}
120+
}
121+
},
122+
{
123+
"commandStartedEvent": {
124+
"commandName": "getMore",
125+
"databaseName": "test",
126+
"command": {
127+
"getMore": {
128+
"$$type": [
129+
"int",
130+
"long"
131+
]
132+
},
133+
"collection": "coll"
134+
}
135+
}
136+
},
137+
{
138+
"commandStartedEvent": {
139+
"commandName": "aggregate",
140+
"databaseName": "test",
141+
"command": {
142+
"aggregate": "coll",
143+
"maxTimeMS": {
144+
"$$type": [
145+
"int",
146+
"long"
147+
]
148+
}
149+
}
150+
}
151+
},
152+
{
153+
"commandStartedEvent": {
154+
"commandName": "getMore",
155+
"databaseName": "test",
156+
"command": {
157+
"getMore": {
158+
"$$type": [
159+
"int",
160+
"long"
161+
]
162+
},
163+
"collection": "coll"
164+
}
165+
}
166+
}
167+
]
168+
}
169+
]
170+
}
171+
]
172+
}

0 commit comments

Comments
 (0)