diff --git a/.evergreen/config.yml b/.evergreen/config.yml index d17054169f..2a65324300 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -292,6 +292,7 @@ functions: DISABLE_TEST_COMMANDS=${DISABLE_TEST_COMMANDS} \ ORCHESTRATION_FILE=${ORCHESTRATION_FILE} \ REQUIRE_API_VERSION=${REQUIRE_API_VERSION} \ + LOAD_BALANCER=${LOAD_BALANCER} \ bash ${DRIVERS_TOOLS}/.evergreen/run-orchestration.sh # run-orchestration generates expansion file with the MONGODB_URI for the cluster - command: expansions.update @@ -457,6 +458,7 @@ functions: fi if [ -n "${test_loadbalancer}" ]; then export TEST_LOADBALANCER=1 + export LOAD_BALANCER=1 export SINGLE_MONGOS_LB_URI="${SINGLE_MONGOS_LB_URI}" export MULTI_MONGOS_LB_URI="${MULTI_MONGOS_LB_URI}" fi @@ -1712,8 +1714,12 @@ tasks: commands: - func: "bootstrap mongo-orchestration" vars: + VERSION: "latest" TOPOLOGY: "sharded_cluster" + LOAD_BALANCER: true - func: "run load-balancer" + vars: + LOAD_BALANCER: true - func: "run tests" - name: "test-fips-standalone" diff --git a/pymongo/pool.py b/pymongo/pool.py index d616408ef8..61945e2d5b 100644 --- a/pymongo/pool.py +++ b/pymongo/pool.py @@ -248,9 +248,6 @@ def _set_keepalive_times(sock): # main thread, to avoid the deadlock. See PYTHON-607. "foo".encode("idna") -# Remove after PYTHON-2712 -_MOCK_SERVICE_ID = False - def _raise_connection_failure(address, error, msg_prefix=None): """Convert a socket.error to ConnectionFailure and raise it.""" @@ -633,10 +630,6 @@ def _hello(self, cluster_time, topology_version, heartbeat_frequency): auth_ctx = None doc = self.command("admin", cmd, publish_events=False, exhaust_allowed=awaitable) - # PYTHON-2712 will remove this topologyVersion fallback logic. - if self.opts.load_balanced and _MOCK_SERVICE_ID: - process_id = doc.get("topologyVersion", {}).get("processId") - doc.setdefault("serviceId", process_id) if not self.opts.load_balanced: doc.pop("serviceId", None) hello = Hello(doc, awaitable=awaitable) diff --git a/test/__init__.py b/test/__init__.py index 32220cfff3..d75c011547 100644 --- a/test/__init__.py +++ b/test/__init__.py @@ -101,10 +101,6 @@ SINGLE_MONGOS_LB_URI = os.environ.get("SINGLE_MONGOS_LB_URI") MULTI_MONGOS_LB_URI = os.environ.get("MULTI_MONGOS_LB_URI") if TEST_LOADBALANCER: - # Remove after PYTHON-2712 - from pymongo import pool - - pool._MOCK_SERVICE_ID = True res = parse_uri(SINGLE_MONGOS_LB_URI or "") host, port = res["nodelist"][0] db_user = res["username"] or db_user