Skip to content

Commit 287c98a

Browse files
test(NODE-7111): sync CSOT spec tests to latest (#4796)
1 parent 1cc3d1c commit 287c98a

File tree

3 files changed

+347
-9
lines changed

3 files changed

+347
-9
lines changed

test/integration/client-side-operations-timeout/client_side_operations_timeout.spec.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ const skippedTests = {
1818
'timeoutMS is refreshed for getMore - failure':
1919
'TODO(DRIVERS-2965): see modified test in unified-csot-node-specs',
2020
'timeoutMS applies to full resume attempt in a next call': 'TODO(DRIVERS-3006)',
21-
'timeoutMS is refreshed for getMore if maxAwaitTimeMS is set': 'TODO(DRIVERS-3018)'
21+
'timeoutMS is refreshed for getMore if maxAwaitTimeMS is set': 'TODO(DRIVERS-3018)',
22+
'error on aggregate if maxAwaitTimeMS is greater than timeoutMS': 'TODO(NODE-7297)',
23+
'error on aggregate if maxAwaitTimeMS is equal to timeoutMS': 'TODO(NODE-7297)',
24+
'apply remaining timeoutMS if less than maxAwaitTimeMS': 'TODO(NODE-7297)'
2225
};
2326

2427
describe('CSOT spec tests', function () {

test/spec/client-side-operations-timeout/tailable-awaitData.json

Lines changed: 215 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"schemaVersion": "1.9",
44
"runOnRequirements": [
55
{
6-
"minServerVersion": "4.4"
6+
"minServerVersion": "4.4",
7+
"serverless": "forbid"
78
}
89
],
910
"createEntities": [
@@ -77,7 +78,7 @@
7778
]
7879
},
7980
{
80-
"description": "error if maxAwaitTimeMS is greater than timeoutMS",
81+
"description": "error on find if maxAwaitTimeMS is greater than timeoutMS",
8182
"operations": [
8283
{
8384
"name": "find",
@@ -89,13 +90,50 @@
8990
"maxAwaitTimeMS": 10
9091
},
9192
"expectError": {
92-
"isClientError": true
93+
"isClientError": true,
94+
"isTimeoutError": false
95+
}
96+
}
97+
]
98+
},
99+
{
100+
"description": "error on aggregate if maxAwaitTimeMS is greater than timeoutMS",
101+
"operations": [
102+
{
103+
"name": "aggregate",
104+
"object": "collection",
105+
"arguments": {
106+
"pipeline": [],
107+
"timeoutMS": 5,
108+
"maxAwaitTimeMS": 10
109+
},
110+
"expectError": {
111+
"isClientError": true,
112+
"isTimeoutError": false
93113
}
94114
}
95115
]
96116
},
97117
{
98-
"description": "error if maxAwaitTimeMS is equal to timeoutMS",
118+
"description": "error on watch if maxAwaitTimeMS is greater than timeoutMS",
119+
"operations": [
120+
{
121+
"name": "createChangeStream",
122+
"object": "collection",
123+
"arguments": {
124+
"pipeline": [],
125+
"timeoutMS": 5,
126+
"maxAwaitTimeMS": 10
127+
},
128+
"expectError": {
129+
"isClientError": true,
130+
"isTimeoutError": false
131+
}
132+
}
133+
]
134+
},
135+
{
136+
"description": "error on find if maxAwaitTimeMS is equal to timeoutMS",
99137
"operations": [
100138
{
101139
"name": "find",
@@ -107,7 +145,44 @@
107145
"maxAwaitTimeMS": 5
108146
},
109147
"expectError": {
110-
"isClientError": true
148+
"isClientError": true,
149+
"isTimeoutError": false
150+
}
151+
}
152+
]
153+
},
154+
{
155+
"description": "error on aggregate if maxAwaitTimeMS is equal to timeoutMS",
156+
"operations": [
157+
{
158+
"name": "aggregate",
159+
"object": "collection",
160+
"arguments": {
161+
"pipeline": [],
162+
"timeoutMS": 5,
163+
"maxAwaitTimeMS": 5
164+
},
165+
"expectError": {
166+
"isClientError": true,
167+
"isTimeoutError": false
168+
}
169+
}
170+
]
171+
},
172+
{
173+
"description": "error on watch if maxAwaitTimeMS is equal to timeoutMS",
174+
"operations": [
175+
{
176+
"name": "createChangeStream",
177+
"object": "collection",
178+
"arguments": {
179+
"pipeline": [],
180+
"timeoutMS": 5,
181+
"maxAwaitTimeMS": 5
182+
},
183+
"expectError": {
184+
"isClientError": true,
185+
"isTimeoutError": false
111186
}
112187
}
113188
]
@@ -417,6 +492,141 @@
417492
]
418493
}
419494
]
495+
},
496+
{
497+
"description": "apply remaining timeoutMS if less than maxAwaitTimeMS",
498+
"operations": [
499+
{
500+
"name": "failPoint",
501+
"object": "testRunner",
502+
"arguments": {
503+
"client": "failPointClient",
504+
"failPoint": {
505+
"configureFailPoint": "failCommand",
506+
"mode": {
507+
"times": 1
508+
},
509+
"data": {
510+
"failCommands": [
511+
"getMore"
512+
],
513+
"blockConnection": true,
514+
"blockTimeMS": 30
515+
}
516+
}
517+
}
518+
},
519+
{
520+
"name": "createFindCursor",
521+
"object": "collection",
522+
"arguments": {
523+
"filter": {
524+
"_id": 1
525+
},
526+
"cursorType": "tailableAwait",
527+
"batchSize": 1,
528+
"maxAwaitTimeMS": 100,
529+
"timeoutMS": 200
530+
},
531+
"saveResultAsEntity": "tailableCursor"
532+
},
533+
{
534+
"name": "iterateOnce",
535+
"object": "tailableCursor"
536+
},
537+
{
538+
"name": "iterateUntilDocumentOrError",
539+
"object": "tailableCursor",
540+
"expectError": {
541+
"isTimeoutError": true
542+
}
543+
}
544+
],
545+
"expectEvents": [
546+
{
547+
"client": "client",
548+
"ignoreExtraEvents": true,
549+
"events": [
550+
{
551+
"commandStartedEvent": {
552+
"commandName": "find",
553+
"databaseName": "test"
554+
}
555+
},
556+
{
557+
"commandStartedEvent": {
558+
"commandName": "getMore",
559+
"databaseName": "test",
560+
"command": {
561+
"maxTimeMS": {
562+
"$$lte": 100
563+
}
564+
}
565+
}
566+
},
567+
{
568+
"commandStartedEvent": {
569+
"commandName": "getMore",
570+
"databaseName": "test",
571+
"command": {
572+
"maxTimeMS": {
573+
"$$lte": 70
574+
}
575+
}
576+
}
577+
}
578+
]
579+
}
580+
]
581+
},
582+
{
583+
"description": "apply maxAwaitTimeMS if less than remaining timeout",
584+
"operations": [
585+
{
586+
"name": "createFindCursor",
587+
"object": "collection",
588+
"arguments": {
589+
"filter": {},
590+
"cursorType": "tailableAwait",
591+
"batchSize": 1,
592+
"maxAwaitTimeMS": 100,
593+
"timeoutMS": 200
594+
},
595+
"saveResultAsEntity": "tailableCursor"
596+
},
597+
{
598+
"name": "iterateOnce",
599+
"object": "tailableCursor"
600+
},
601+
{
602+
"name": "iterateOnce",
603+
"object": "tailableCursor"
604+
}
605+
],
606+
"expectEvents": [
607+
{
608+
"client": "client",
609+
"events": [
610+
{
611+
"commandStartedEvent": {
612+
"commandName": "find",
613+
"databaseName": "test"
614+
}
615+
},
616+
{
617+
"commandStartedEvent": {
618+
"commandName": "getMore",
619+
"databaseName": "test",
620+
"command": {
621+
"maxTimeMS": {
622+
"$$lte": 100
623+
}
624+
}
625+
}
626+
}
627+
]
628+
}
629+
]
420630
}
421631
]
422632
}

0 commit comments

Comments
 (0)