Skip to content

Commit 59ca01e

Browse files
committed
Converted transaction spec tests
1 parent 93c5c76 commit 59ca01e

37 files changed

+32835
-0
lines changed

tests/UnifiedSpecTests/transactions/abort.json

Lines changed: 834 additions & 0 deletions
Large diffs are not rendered by default.

tests/UnifiedSpecTests/transactions/bulk.json

Lines changed: 658 additions & 0 deletions
Large diffs are not rendered by default.

tests/UnifiedSpecTests/transactions/causal-consistency.json

Lines changed: 426 additions & 0 deletions
Large diffs are not rendered by default.

tests/UnifiedSpecTests/transactions/commit.json

Lines changed: 1234 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
{
2+
"description": "count",
3+
"schemaVersion": "1.3",
4+
"createEntities": [
5+
{
6+
"client": {
7+
"id": "client0",
8+
"useMultipleMongoses": false,
9+
"observeEvents": [
10+
"commandStartedEvent"
11+
]
12+
}
13+
},
14+
{
15+
"database": {
16+
"id": "database0",
17+
"client": "client0",
18+
"databaseName": "transaction-tests"
19+
}
20+
},
21+
{
22+
"collection": {
23+
"id": "collection0",
24+
"database": "database0",
25+
"collectionName": "test"
26+
}
27+
},
28+
{
29+
"session": {
30+
"id": "session0",
31+
"client": "client0"
32+
}
33+
},
34+
{
35+
"session": {
36+
"id": "session1",
37+
"client": "client0"
38+
}
39+
}
40+
],
41+
"runOnRequirements": [
42+
{
43+
"minServerVersion": "4.0.2",
44+
"topologies": [
45+
"replicaset"
46+
]
47+
},
48+
{
49+
"minServerVersion": "4.1.8",
50+
"topologies": [
51+
"sharded",
52+
"load-balanced"
53+
]
54+
}
55+
],
56+
"initialData": [
57+
{
58+
"collectionName": "test",
59+
"databaseName": "transaction-tests",
60+
"documents": [
61+
{
62+
"_id": 1
63+
},
64+
{
65+
"_id": 2
66+
},
67+
{
68+
"_id": 3
69+
},
70+
{
71+
"_id": 4
72+
}
73+
]
74+
}
75+
],
76+
"tests": [
77+
{
78+
"description": "count",
79+
"operations": [
80+
{
81+
"object": "session0",
82+
"name": "startTransaction"
83+
},
84+
{
85+
"object": "collection0",
86+
"name": "count",
87+
"arguments": {
88+
"session": "session0",
89+
"filter": {
90+
"_id": 1
91+
}
92+
},
93+
"expectError": {
94+
"errorCodeName": "OperationNotSupportedInTransaction",
95+
"errorLabelsOmit": [
96+
"TransientTransactionError",
97+
"UnknownTransactionCommitResult"
98+
]
99+
}
100+
},
101+
{
102+
"object": "session0",
103+
"name": "abortTransaction"
104+
}
105+
],
106+
"expectEvents": [
107+
{
108+
"client": "client0",
109+
"events": [
110+
{
111+
"commandStartedEvent": {
112+
"command": {
113+
"count": "test",
114+
"query": {
115+
"_id": 1
116+
},
117+
"readConcern": {
118+
"$$exists": false
119+
},
120+
"lsid": {
121+
"$$sessionLsid": "session0"
122+
},
123+
"txnNumber": {
124+
"$numberLong": "1"
125+
},
126+
"startTransaction": true,
127+
"autocommit": false,
128+
"writeConcern": {
129+
"$$exists": false
130+
}
131+
},
132+
"commandName": "count",
133+
"databaseName": "transaction-tests"
134+
}
135+
},
136+
{
137+
"commandStartedEvent": {
138+
"command": {
139+
"abortTransaction": 1,
140+
"lsid": {
141+
"$$sessionLsid": "session0"
142+
},
143+
"txnNumber": {
144+
"$numberLong": "1"
145+
},
146+
"startTransaction": {
147+
"$$exists": false
148+
},
149+
"autocommit": false,
150+
"writeConcern": {
151+
"$$exists": false
152+
}
153+
},
154+
"commandName": "abortTransaction",
155+
"databaseName": "admin"
156+
}
157+
}
158+
]
159+
}
160+
],
161+
"outcome": [
162+
{
163+
"collectionName": "test",
164+
"databaseName": "transaction-tests",
165+
"documents": [
166+
{
167+
"_id": 1
168+
},
169+
{
170+
"_id": 2
171+
},
172+
{
173+
"_id": 3
174+
},
175+
{
176+
"_id": 4
177+
}
178+
]
179+
}
180+
]
181+
}
182+
]
183+
}

0 commit comments

Comments
 (0)