Skip to content

Commit d3e66a6

Browse files
authored
PYTHON-2308 Test that we exclusively depend on existence of logicalSessionsTimeoutMinutes for sessions support (#499)
1 parent 337a08c commit d3e66a6

File tree

2 files changed

+181
-165
lines changed

2 files changed

+181
-165
lines changed

test/sessions/dirty-session-errors.json

Lines changed: 0 additions & 165 deletions
Original file line numberDiff line numberDiff line change
@@ -21,171 +21,6 @@
2121
}
2222
],
2323
"tests": [
24-
{
25-
"description": "Clean explicit session is not discarded",
26-
"operations": [
27-
{
28-
"name": "assertSessionNotDirty",
29-
"object": "testRunner",
30-
"arguments": {
31-
"session": "session0"
32-
}
33-
},
34-
{
35-
"name": "insertOne",
36-
"object": "collection",
37-
"arguments": {
38-
"session": "session0",
39-
"document": {
40-
"_id": 2
41-
}
42-
},
43-
"result": {
44-
"insertedId": 2
45-
}
46-
},
47-
{
48-
"name": "assertSessionNotDirty",
49-
"object": "testRunner",
50-
"arguments": {
51-
"session": "session0"
52-
}
53-
},
54-
{
55-
"name": "endSession",
56-
"object": "session0"
57-
},
58-
{
59-
"name": "find",
60-
"object": "collection",
61-
"arguments": {
62-
"filter": {
63-
"_id": -1
64-
}
65-
},
66-
"result": []
67-
},
68-
{
69-
"name": "assertSameLsidOnLastTwoCommands",
70-
"object": "testRunner"
71-
}
72-
],
73-
"expectations": [
74-
{
75-
"command_started_event": {
76-
"command": {
77-
"insert": "test",
78-
"documents": [
79-
{
80-
"_id": 2
81-
}
82-
],
83-
"ordered": true,
84-
"lsid": "session0"
85-
},
86-
"command_name": "insert",
87-
"database_name": "session-tests"
88-
}
89-
},
90-
{
91-
"command_started_event": {
92-
"command": {
93-
"find": "test",
94-
"filter": {
95-
"_id": -1
96-
},
97-
"lsid": "session0"
98-
},
99-
"command_name": "find",
100-
"database_name": "session-tests"
101-
}
102-
}
103-
],
104-
"outcome": {
105-
"collection": {
106-
"data": [
107-
{
108-
"_id": 1
109-
},
110-
{
111-
"_id": 2
112-
}
113-
]
114-
}
115-
}
116-
},
117-
{
118-
"description": "Clean implicit session is not discarded",
119-
"operations": [
120-
{
121-
"name": "insertOne",
122-
"object": "collection",
123-
"arguments": {
124-
"document": {
125-
"_id": 2
126-
}
127-
},
128-
"result": {
129-
"insertedId": 2
130-
}
131-
},
132-
{
133-
"name": "find",
134-
"object": "collection",
135-
"arguments": {
136-
"filter": {
137-
"_id": -1
138-
}
139-
},
140-
"result": []
141-
},
142-
{
143-
"name": "assertSameLsidOnLastTwoCommands",
144-
"object": "testRunner"
145-
}
146-
],
147-
"expectations": [
148-
{
149-
"command_started_event": {
150-
"command": {
151-
"insert": "test",
152-
"documents": [
153-
{
154-
"_id": 2
155-
}
156-
],
157-
"ordered": true
158-
},
159-
"command_name": "insert",
160-
"database_name": "session-tests"
161-
}
162-
},
163-
{
164-
"command_started_event": {
165-
"command": {
166-
"find": "test",
167-
"filter": {
168-
"_id": -1
169-
}
170-
},
171-
"command_name": "find",
172-
"database_name": "session-tests"
173-
}
174-
}
175-
],
176-
"outcome": {
177-
"collection": {
178-
"data": [
179-
{
180-
"_id": 1
181-
},
182-
{
183-
"_id": 2
184-
}
185-
]
186-
}
187-
}
188-
},
18924
{
19025
"description": "Dirty explicit session is discarded",
19126
"clientOptions": {

test/sessions/server-support.json

Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
{
2+
"runOn": [
3+
{
4+
"minServerVersion": "3.6.0"
5+
}
6+
],
7+
"database_name": "session-tests",
8+
"collection_name": "test",
9+
"data": [
10+
{
11+
"_id": 1
12+
}
13+
],
14+
"tests": [
15+
{
16+
"description": "Server supports explicit sessions",
17+
"operations": [
18+
{
19+
"name": "assertSessionNotDirty",
20+
"object": "testRunner",
21+
"arguments": {
22+
"session": "session0"
23+
}
24+
},
25+
{
26+
"name": "insertOne",
27+
"object": "collection",
28+
"arguments": {
29+
"session": "session0",
30+
"document": {
31+
"_id": 2
32+
}
33+
},
34+
"result": {
35+
"insertedId": 2
36+
}
37+
},
38+
{
39+
"name": "assertSessionNotDirty",
40+
"object": "testRunner",
41+
"arguments": {
42+
"session": "session0"
43+
}
44+
},
45+
{
46+
"name": "endSession",
47+
"object": "session0"
48+
},
49+
{
50+
"name": "find",
51+
"object": "collection",
52+
"arguments": {
53+
"filter": {
54+
"_id": -1
55+
}
56+
},
57+
"result": []
58+
},
59+
{
60+
"name": "assertSameLsidOnLastTwoCommands",
61+
"object": "testRunner"
62+
}
63+
],
64+
"expectations": [
65+
{
66+
"command_started_event": {
67+
"command": {
68+
"insert": "test",
69+
"documents": [
70+
{
71+
"_id": 2
72+
}
73+
],
74+
"ordered": true,
75+
"lsid": "session0"
76+
},
77+
"command_name": "insert",
78+
"database_name": "session-tests"
79+
}
80+
},
81+
{
82+
"command_started_event": {
83+
"command": {
84+
"find": "test",
85+
"filter": {
86+
"_id": -1
87+
},
88+
"lsid": "session0"
89+
},
90+
"command_name": "find",
91+
"database_name": "session-tests"
92+
}
93+
}
94+
],
95+
"outcome": {
96+
"collection": {
97+
"data": [
98+
{
99+
"_id": 1
100+
},
101+
{
102+
"_id": 2
103+
}
104+
]
105+
}
106+
}
107+
},
108+
{
109+
"description": "Server supports implicit sessions",
110+
"operations": [
111+
{
112+
"name": "insertOne",
113+
"object": "collection",
114+
"arguments": {
115+
"document": {
116+
"_id": 2
117+
}
118+
},
119+
"result": {
120+
"insertedId": 2
121+
}
122+
},
123+
{
124+
"name": "find",
125+
"object": "collection",
126+
"arguments": {
127+
"filter": {
128+
"_id": -1
129+
}
130+
},
131+
"result": []
132+
},
133+
{
134+
"name": "assertSameLsidOnLastTwoCommands",
135+
"object": "testRunner"
136+
}
137+
],
138+
"expectations": [
139+
{
140+
"command_started_event": {
141+
"command": {
142+
"insert": "test",
143+
"documents": [
144+
{
145+
"_id": 2
146+
}
147+
],
148+
"ordered": true
149+
},
150+
"command_name": "insert",
151+
"database_name": "session-tests"
152+
}
153+
},
154+
{
155+
"command_started_event": {
156+
"command": {
157+
"find": "test",
158+
"filter": {
159+
"_id": -1
160+
}
161+
},
162+
"command_name": "find",
163+
"database_name": "session-tests"
164+
}
165+
}
166+
],
167+
"outcome": {
168+
"collection": {
169+
"data": [
170+
{
171+
"_id": 1
172+
},
173+
{
174+
"_id": 2
175+
}
176+
]
177+
}
178+
}
179+
}
180+
]
181+
}

0 commit comments

Comments
 (0)