Skip to content

Commit d831109

Browse files
[CDRIVER-4436] Add do-not-retry-read-in-transaction tests (#1089)
1 parent f5073ca commit d831109

File tree

1 file changed

+115
-0
lines changed

1 file changed

+115
-0
lines changed
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
{
2+
"description": "do not retry read in a transaction",
3+
"schemaVersion": "1.4",
4+
"runOnRequirements": [
5+
{
6+
"minServerVersion": "4.0.0",
7+
"topologies": [
8+
"replicaset"
9+
]
10+
},
11+
{
12+
"minServerVersion": "4.2.0",
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+
"uriOptions": {
28+
"retryReads": true
29+
}
30+
}
31+
},
32+
{
33+
"database": {
34+
"id": "database0",
35+
"client": "client0",
36+
"databaseName": "retryable-read-in-transaction-test"
37+
}
38+
},
39+
{
40+
"collection": {
41+
"id": "collection0",
42+
"database": "database0",
43+
"collectionName": "coll"
44+
}
45+
},
46+
{
47+
"session": {
48+
"id": "session0",
49+
"client": "client0"
50+
}
51+
}
52+
],
53+
"tests": [
54+
{
55+
"description": "find does not retry in a transaction",
56+
"operations": [
57+
{
58+
"name": "startTransaction",
59+
"object": "session0"
60+
},
61+
{
62+
"name": "failPoint",
63+
"object": "testRunner",
64+
"arguments": {
65+
"client": "client0",
66+
"failPoint": {
67+
"configureFailPoint": "failCommand",
68+
"mode": {
69+
"times": 1
70+
},
71+
"data": {
72+
"failCommands": [
73+
"find"
74+
],
75+
"closeConnection": true
76+
}
77+
}
78+
}
79+
},
80+
{
81+
"name": "find",
82+
"object": "collection0",
83+
"arguments": {
84+
"filter": {},
85+
"session": "session0"
86+
},
87+
"expectError": {
88+
"isError": true,
89+
"errorLabelsContain": [
90+
"TransientTransactionError"
91+
]
92+
}
93+
}
94+
],
95+
"expectEvents": [
96+
{
97+
"client": "client0",
98+
"events": [
99+
{
100+
"commandStartedEvent": {
101+
"command": {
102+
"find": "coll",
103+
"filter": {},
104+
"startTransaction": true
105+
},
106+
"commandName": "find",
107+
"databaseName": "retryable-read-in-transaction-test"
108+
}
109+
}
110+
]
111+
}
112+
]
113+
}
114+
]
115+
}

0 commit comments

Comments
 (0)