Skip to content

Commit e62d4b5

Browse files
committed
wip Sync converted transaction spec tests
POC for mongodb/specifications#1502
1 parent 72c92d6 commit e62d4b5

35 files changed

+32661
-0
lines changed

tests/UnifiedSpecTests/transactions/abort.json

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

tests/UnifiedSpecTests/transactions/bulk.json

Lines changed: 652 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: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
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+
"initialData": [
51+
{
52+
"collectionName": "test",
53+
"databaseName": "transaction-tests",
54+
"documents": [
55+
{
56+
"_id": 1
57+
},
58+
{
59+
"_id": 2
60+
},
61+
{
62+
"_id": 3
63+
},
64+
{
65+
"_id": 4
66+
}
67+
]
68+
}
69+
],
70+
"tests": [
71+
{
72+
"description": "count",
73+
"operations": [
74+
{
75+
"object": "session0",
76+
"name": "startTransaction"
77+
},
78+
{
79+
"object": "collection0",
80+
"name": "count",
81+
"arguments": {
82+
"session": "session0",
83+
"filter": {
84+
"_id": 1
85+
}
86+
},
87+
"expectError": {
88+
"errorCodeName": "OperationNotSupportedInTransaction",
89+
"errorLabelsOmit": [
90+
"TransientTransactionError",
91+
"UnknownTransactionCommitResult"
92+
]
93+
}
94+
},
95+
{
96+
"object": "session0",
97+
"name": "abortTransaction"
98+
}
99+
],
100+
"expectEvents": [
101+
{
102+
"client": "client0",
103+
"events": [
104+
{
105+
"commandStartedEvent": {
106+
"command": {
107+
"count": "test",
108+
"query": {
109+
"_id": 1
110+
},
111+
"readConcern": {
112+
"$$exists": false
113+
},
114+
"lsid": {
115+
"$$sessionLsid": "session0"
116+
},
117+
"txnNumber": {
118+
"$numberLong": "1"
119+
},
120+
"startTransaction": true,
121+
"autocommit": false,
122+
"writeConcern": {
123+
"$$exists": false
124+
}
125+
},
126+
"commandName": "count",
127+
"databaseName": "transaction-tests"
128+
}
129+
},
130+
{
131+
"commandStartedEvent": {
132+
"command": {
133+
"abortTransaction": 1,
134+
"lsid": {
135+
"$$sessionLsid": "session0"
136+
},
137+
"txnNumber": {
138+
"$numberLong": "1"
139+
},
140+
"startTransaction": {
141+
"$$exists": false
142+
},
143+
"autocommit": false,
144+
"writeConcern": {
145+
"$$exists": false
146+
}
147+
},
148+
"commandName": "abortTransaction",
149+
"databaseName": "admin"
150+
}
151+
}
152+
]
153+
}
154+
],
155+
"outcome": [
156+
{
157+
"collectionName": "test",
158+
"databaseName": "transaction-tests",
159+
"documents": [
160+
{
161+
"_id": 1
162+
},
163+
{
164+
"_id": 2
165+
},
166+
{
167+
"_id": 3
168+
},
169+
{
170+
"_id": 4
171+
}
172+
]
173+
}
174+
]
175+
}
176+
]
177+
}

0 commit comments

Comments
 (0)