Skip to content

Commit 3ad8843

Browse files
committed
wip Sync converted transaction spec tests
POC for mongodb/specifications#1502
1 parent b4a3007 commit 3ad8843

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+
"runOnRequirements": [
5+
{
6+
"minServerVersion": "4.0.2",
7+
"topologies": [
8+
"replicaset"
9+
]
10+
},
11+
{
12+
"minServerVersion": "4.1.8",
13+
"topologies": [
14+
"sharded",
15+
"load-balanced"
16+
]
17+
}
18+
],
19+
"createEntities": [
20+
{
21+
"client": {
22+
"id": "client0",
23+
"useMultipleMongoses": false,
24+
"observeEvents": [
25+
"commandStartedEvent"
26+
]
27+
}
28+
},
29+
{
30+
"database": {
31+
"id": "database0",
32+
"client": "client0",
33+
"databaseName": "transaction-tests"
34+
}
35+
},
36+
{
37+
"collection": {
38+
"id": "collection0",
39+
"database": "database0",
40+
"collectionName": "test"
41+
}
42+
},
43+
{
44+
"session": {
45+
"id": "session0",
46+
"client": "client0"
47+
}
48+
},
49+
{
50+
"session": {
51+
"id": "session1",
52+
"client": "client0"
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)