File tree Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -227,6 +227,8 @@ async def test_retryable_reads_are_retried_on_the_same_implicit_session(self):
227
227
retryReads = True ,
228
228
)
229
229
230
+ await client .t .t .insert_one ({"x" : 1 })
231
+
230
232
commands = [
231
233
("aggregate" , lambda : client .t .t .count_documents ({})),
232
234
("aggregate" , lambda : client .t .t .aggregate ([{"$match" : {}}])),
@@ -250,13 +252,14 @@ async def test_retryable_reads_are_retried_on_the_same_implicit_session(self):
250
252
await operation ()
251
253
252
254
# Assert that both events occurred on the same session.
253
- lsids = [
254
- event .command [ "lsid" ]
255
+ command_docs = [
256
+ event .command
255
257
for event in listener .started_events
256
258
if event .command_name == command_name
257
259
]
258
- self .assertEqual (len (lsids ), 2 )
259
- self .assertEqual (lsids [0 ], lsids [1 ])
260
+ self .assertEqual (len (command_docs ), 2 )
261
+ self .assertEqual (command_docs [0 ]["lsid" ], command_docs [1 ]["lsid" ])
262
+ self .assertIsNot (command_docs [0 ], command_docs [1 ])
260
263
261
264
262
265
if __name__ == "__main__" :
Original file line number Diff line number Diff line change @@ -225,6 +225,8 @@ def test_retryable_reads_are_retried_on_the_same_implicit_session(self):
225
225
retryReads = True ,
226
226
)
227
227
228
+ client .t .t .insert_one ({"x" : 1 })
229
+
228
230
commands = [
229
231
("aggregate" , lambda : client .t .t .count_documents ({})),
230
232
("aggregate" , lambda : client .t .t .aggregate ([{"$match" : {}}])),
@@ -248,13 +250,14 @@ def test_retryable_reads_are_retried_on_the_same_implicit_session(self):
248
250
operation ()
249
251
250
252
# Assert that both events occurred on the same session.
251
- lsids = [
252
- event .command [ "lsid" ]
253
+ command_docs = [
254
+ event .command
253
255
for event in listener .started_events
254
256
if event .command_name == command_name
255
257
]
256
- self .assertEqual (len (lsids ), 2 )
257
- self .assertEqual (lsids [0 ], lsids [1 ])
258
+ self .assertEqual (len (command_docs ), 2 )
259
+ self .assertEqual (command_docs [0 ]["lsid" ], command_docs [1 ]["lsid" ])
260
+ self .assertIsNot (command_docs [0 ], command_docs [1 ])
258
261
259
262
260
263
if __name__ == "__main__" :
You can’t perform that action at this time.
0 commit comments