Skip to content

Commit 8eba3f6

Browse files
authored
CDRIVER-5770 Convert retryable write command construction prose tests to spec tests (#1800)
* sync spec tests to 11022ca * remove extra `bson_destroy` The `bson_t` is allocated with `tmp_bson`. Destroying results in a double free when the test runner destroys temporary `bson_t`. * make failure to clean up failpoints terminate tests * create internal mongo client after possibly modifying URI * use single mongos for handling initialData * use primary, not primaryPreferred, read preference To match spec.
1 parent b0edf30 commit 8eba3f6

15 files changed

+3687
-14
lines changed
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
{
2+
"description": "aggregate with $out/$merge does not set txnNumber",
3+
"schemaVersion": "1.3",
4+
"runOnRequirements": [
5+
{
6+
"minServerVersion": "3.6",
7+
"topologies": [
8+
"replicaset",
9+
"sharded",
10+
"load-balanced"
11+
]
12+
}
13+
],
14+
"createEntities": [
15+
{
16+
"client": {
17+
"id": "client0",
18+
"observeEvents": [
19+
"commandStartedEvent"
20+
]
21+
}
22+
},
23+
{
24+
"database": {
25+
"id": "database0",
26+
"client": "client0",
27+
"databaseName": "retryable-writes-tests"
28+
}
29+
},
30+
{
31+
"collection": {
32+
"id": "collection0",
33+
"database": "database0",
34+
"collectionName": "coll0"
35+
}
36+
}
37+
],
38+
"initialData": [
39+
{
40+
"collectionName": "mergeCollection",
41+
"databaseName": "retryable-writes-tests",
42+
"documents": []
43+
}
44+
],
45+
"tests": [
46+
{
47+
"description": "aggregate with $out does not set txnNumber",
48+
"operations": [
49+
{
50+
"object": "collection0",
51+
"name": "aggregate",
52+
"arguments": {
53+
"pipeline": [
54+
{
55+
"$sort": {
56+
"x": 1
57+
}
58+
},
59+
{
60+
"$match": {
61+
"_id": {
62+
"$gt": 1
63+
}
64+
}
65+
},
66+
{
67+
"$out": "outCollection"
68+
}
69+
]
70+
}
71+
}
72+
],
73+
"expectEvents": [
74+
{
75+
"client": "client0",
76+
"events": [
77+
{
78+
"commandStartedEvent": {
79+
"commandName": "aggregate",
80+
"command": {
81+
"txnNumber": {
82+
"$$exists": false
83+
}
84+
}
85+
}
86+
}
87+
]
88+
}
89+
]
90+
},
91+
{
92+
"description": "aggregate with $merge does not set txnNumber",
93+
"runOnRequirements": [
94+
{
95+
"minServerVersion": "4.1.11"
96+
}
97+
],
98+
"operations": [
99+
{
100+
"object": "collection0",
101+
"name": "aggregate",
102+
"arguments": {
103+
"pipeline": [
104+
{
105+
"$sort": {
106+
"x": 1
107+
}
108+
},
109+
{
110+
"$match": {
111+
"_id": {
112+
"$gt": 1
113+
}
114+
}
115+
},
116+
{
117+
"$merge": {
118+
"into": "mergeCollection"
119+
}
120+
}
121+
]
122+
}
123+
}
124+
],
125+
"expectEvents": [
126+
{
127+
"client": "client0",
128+
"events": [
129+
{
130+
"commandStartedEvent": {
131+
"commandName": "aggregate",
132+
"command": {
133+
"txnNumber": {
134+
"$$exists": false
135+
}
136+
}
137+
}
138+
}
139+
]
140+
}
141+
]
142+
}
143+
]
144+
}

0 commit comments

Comments
 (0)