Skip to content

Commit b7f4fae

Browse files
committed
PYTHON-2189 Ignore StaleConfig transaction errors on 4.5+ mongos
1 parent 8d41a38 commit b7f4fae

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/test_transactions.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,13 @@ def create_test(scenario_def, test, name):
404404
@client_context.require_test_commands
405405
@client_context.require_transactions
406406
def run_scenario(self):
407-
self.run_scenario(scenario_def, test)
407+
try:
408+
self.run_scenario(scenario_def, test)
409+
except OperationFailure as exc:
410+
if (client_context.version.at_least(4, 5) and
411+
client_context.is_mongos and exc.code == 13388):
412+
self.skipTest('PYTHON-2189 Ignoring StaleConfig error: %r' % (
413+
exc.details))
408414

409415
return run_scenario
410416

0 commit comments

Comments
 (0)