From 354c96a414ea30cdb9bd23971a28e3cc2fab3a89 Mon Sep 17 00:00:00 2001 From: Shane Harvey Date: Mon, 28 Jun 2021 15:11:52 -0700 Subject: [PATCH] PYTHON-2779 Fix topologies field in snapshot reads test (#657) --- test/__init__.py | 4 ++++ ...shot-sessions-not-supported-server-error.json | 16 +++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/test/__init__.py b/test/__init__.py index 2eee97177..28c46918f 100644 --- a/test/__init__.py +++ b/test/__init__.py @@ -673,6 +673,10 @@ class ClientContext(object): func=func) def is_topology_type(self, topologies): + unknown = set(topologies) - {'single', 'replicaset', 'sharded', + 'sharded-replicaset', 'load-balanced'} + if unknown: + raise AssertionError('Unknown topologies: %r' % (unknown,)) if self.load_balancer: if 'load-balanced' in topologies: return True diff --git a/test/sessions/unified/snapshot-sessions-not-supported-server-error.json b/test/sessions/unified/snapshot-sessions-not-supported-server-error.json index 896a11c6e..b6ce00216 100644 --- a/test/sessions/unified/snapshot-sessions-not-supported-server-error.json +++ b/test/sessions/unified/snapshot-sessions-not-supported-server-error.json @@ -4,9 +4,12 @@ "runOnRequirements": [ { "minServerVersion": "3.6", - "maxServerVersion": "4.4.99", + "maxServerVersion": "4.4.99" + }, + { + "minServerVersion": "3.6", "topologies": [ - "replicaset, sharded-replicaset" + "single" ] } ], @@ -17,6 +20,11 @@ "observeEvents": [ "commandStartedEvent", "commandFailedEvent" + ], + "ignoreCommandMonitoringEvents": [ + "findAndModify", + "insert", + "update" ] } }, @@ -87,9 +95,7 @@ "$$exists": false } } - }, - "commandName": "find", - "databaseName": "database0" + } } }, {