@@ -143,10 +143,10 @@ def run_operation(self, sessions, collection, operation):
143
143
arguments .pop ('readPreference' )['mode' ]), tag_sets = None )
144
144
145
145
if 'writeConcern' in arguments :
146
- write_c = WriteConcern (** arguments .pop ('writeConcern' ))
146
+ write_c = WriteConcern (** dict ( arguments .pop ('writeConcern' ) ))
147
147
148
148
if 'readConcern' in arguments :
149
- read_c = ReadConcern (** arguments .pop ('readConcern' ))
149
+ read_c = ReadConcern (** dict ( arguments .pop ('readConcern' ) ))
150
150
151
151
if name == 'start_transaction' :
152
152
cmd = partial (session .start_transaction ,
@@ -187,12 +187,12 @@ def run_operation(self, sessions, collection, operation):
187
187
bulk_model = camel_to_upper_camel (request ["name" ])
188
188
bulk_class = getattr (operations , bulk_model )
189
189
bulk_arguments = camel_to_snake_args (request ["arguments" ])
190
- requests .append (bulk_class (** bulk_arguments ))
190
+ requests .append (bulk_class (** dict ( bulk_arguments ) ))
191
191
arguments ["requests" ] = requests
192
192
else :
193
193
arguments [c2s ] = arguments .pop (arg_name )
194
194
195
- result = cmd (** arguments )
195
+ result = cmd (** dict ( arguments ) )
196
196
197
197
if name == "aggregate" :
198
198
if arguments ["pipeline" ] and "$out" in arguments ["pipeline" ][- 1 ]:
@@ -281,8 +281,11 @@ def end_sessions(sessions):
281
281
def create_test (scenario_def , test ):
282
282
def run_scenario (self ):
283
283
listener = EventListener ()
284
- # New client to avoid interference from pooled sessions.
285
- client = rs_client (event_listeners = [listener ], ** test ['clientOptions' ])
284
+ # New client, to avoid interference from pooled sessions.
285
+ # Convert test['clientOptions'] to dict to avoid a Jython bug using "**"
286
+ # with ScenarioDict.
287
+ client = rs_client (event_listeners = [listener ],
288
+ ** dict (test ['clientOptions' ]))
286
289
try :
287
290
client .admin .command ('killAllSessions' , [])
288
291
except OperationFailure :
@@ -307,11 +310,13 @@ def run_scenario(self):
307
310
if 'default_transaction_options' in opts :
308
311
txn_opts = opts ['default_transaction_options' ]
309
312
if 'readConcern' in txn_opts :
310
- read_concern = ReadConcern (** txn_opts ['readConcern' ])
313
+ read_concern = ReadConcern (
314
+ ** dict (txn_opts ['readConcern' ]))
311
315
else :
312
316
read_concern = None
313
317
if 'writeConcern' in txn_opts :
314
- write_concern = WriteConcern (** txn_opts ['writeConcern' ])
318
+ write_concern = WriteConcern (
319
+ ** dict (txn_opts ['writeConcern' ]))
315
320
else :
316
321
write_concern = None
317
322
@@ -321,7 +326,7 @@ def run_scenario(self):
321
326
)
322
327
opts ['default_transaction_options' ] = txn_opts
323
328
324
- s = client .start_session (** opts )
329
+ s = client .start_session (** dict ( opts ) )
325
330
326
331
sessions [session_name ] = s
327
332
# Store lsid so we can access it after end_session, in check_events.
0 commit comments