-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathclient_side_operations_timeout.spec.test.ts
More file actions
63 lines (57 loc) · 2.51 KB
/
client_side_operations_timeout.spec.test.ts
File metadata and controls
63 lines (57 loc) · 2.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import { join } from 'path';
import * as semver from 'semver';
import { loadSpecTests } from '../../spec';
import { runUnifiedSuite } from '../../tools/unified-spec-runner/runner';
const skippedSpecs = {};
const skippedTests = {
'Tailable cursor iteration timeoutMS is refreshed for getMore - failure': 'TODO(DRIVERS-2965)',
'Tailable cursor awaitData iteration timeoutMS is refreshed for getMore - failure':
'TODO(DRIVERS-2965)',
'command is not sent if RTT is greater than timeoutMS': 'TODO(DRIVERS-2965)',
'Non-tailable cursor iteration timeoutMS is refreshed for getMore if timeoutMode is iteration - failure':
'TODO(DRIVERS-2965)',
'maxTimeMS value in the command is less than timeoutMS':
'TODO(DRIVERS-2970): see modified test in unified-csot-node-specs',
'timeoutMS is refreshed for getMore - failure':
'TODO(DRIVERS-2965): see modified test in unified-csot-node-specs',
'timeoutMS is refreshed for getMore if maxAwaitTimeMS is set': 'TODO(DRIVERS-3018)',
'error on aggregate if maxAwaitTimeMS is greater than timeoutMS': 'TODO(NODE-7360)',
'error on aggregate if maxAwaitTimeMS is equal to timeoutMS': 'TODO(NODE-7360)',
'apply remaining timeoutMS if less than maxAwaitTimeMS': 'TODO(NODE-7360)'
};
describe('CSOT spec tests', function () {
const specs = loadSpecTests('client-side-operations-timeout');
for (const spec of specs) {
for (const test of spec.tests) {
if (skippedSpecs[spec.name] != null) {
test.skipReason = skippedSpecs[spec.name];
}
if (skippedTests[test.description] != null) {
test.skipReason = skippedTests[test.description];
}
}
}
runUnifiedSuite(specs, (test, configuration) => {
const sessionCSOTTests = ['timeoutMS applied to withTransaction'];
if (
configuration.topologyType === 'LoadBalanced' &&
test.description === 'timeoutMS is refreshed for close'
) {
return 'LoadBalanced cannot refresh timeoutMS and run expected killCursors because pinned connection has been closed by the timeout';
}
if (
sessionCSOTTests.includes(test.description) &&
configuration.topologyType === 'ReplicaSetWithPrimary' &&
semver.satisfies(configuration.version, '<=4.4')
) {
return '4.4 replicaset fail point does not blockConnection for requested time';
}
return false;
});
});
describe('CSOT modified spec tests', function () {
const specs = loadSpecTests(
join('..', 'integration', 'client-side-operations-timeout', 'unified-csot-node-specs')
);
runUnifiedSuite(specs);
});