Skip to content

Commit e588d21

Browse files
authored
test(NODE-3435): topology check for unified runner distinct hack (#2931)
1 parent 2467b82 commit e588d21

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

test/functional/unified-spec-runner/runner.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { executeOperationAndCheck } from './operations';
88
import { matchesEvents } from './match';
99
import { satisfies as semverSatisfies } from 'semver';
1010
import { MongoClient } from '../../../src/mongo_client';
11+
import { TopologyType } from '../../../src/sdam/common';
1112

1213
export type TestConfiguration = InstanceType<
1314
typeof import('../../tools/runner/config')['TestConfiguration']
@@ -143,11 +144,8 @@ export async function runUnifiedTest(
143144
// test runners MUST execute a non-transactional distinct command on
144145
// each mongos server before running any test that might execute distinct within a transaction.
145146
// To ease the implementation, test runners MAY execute distinct before every test.
146-
if (
147-
ctx.topologyType === uni.TopologyType.sharded ||
148-
ctx.topologyType === uni.TopologyType.shardedReplicaset ||
149-
ctx.topologyType === uni.TopologyType.loadBalanced
150-
) {
147+
const topologyType = ctx.configuration.topologyType;
148+
if (topologyType === TopologyType.Sharded || topologyType === TopologyType.LoadBalanced) {
151149
for (const [, collection] of entities.mapOf('collection')) {
152150
await utilClient.db(ns(collection.namespace).db).command({
153151
distinct: collection.collectionName,

0 commit comments

Comments
 (0)