Skip to content

TOOLS-4263 Add multi-node replica set test infrastructure - #1142

Draft
autarch wants to merge 1 commit into
08-17-tools-4263_convert_the_system_ca_tls_test_to_gofrom
08-17-tools-4263_add_multi_node_replica_set_test_infrastructure
Draft

TOOLS-4263 Add multi-node replica set test infrastructure#1142
autarch wants to merge 1 commit into
08-17-tools-4263_convert_the_system_ca_tls_test_to_gofrom
08-17-tools-4263_add_multi_node_replica_set_test_infrastructure

Conversation

@autarch

@autarch autarch commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

Adds a test type and a CI task for tests that need more than one data-bearing
node: a secondary to connect to, or a write concern greater than w:1. No tests
use it yet; the conversions that do follow in later commits.

  • common/testtype/types.go - adds MultiNodeReplSetTestType
    (TOOLS_TESTING_MULTINODE_REPLSET). Additive to common/, so no API change,
    but common/ is used by other projects at MongoDB.

  • buildscript/build.go - -topology=multiNodeReplSet sets both
    TOOLS_TESTING_REPLSET and TOOLS_TESTING_MULTINODE_REPLSET, since a
    three-node set satisfies the single-node replica set tests too.

  • common.yml - adds the integration-multinode-latest task, modeled on
    integration-latest-cluster: the latest server, a three-node set, TLS, and
    test:integration -ssl=true -topology=multiNodeReplSet. It is tagged
    multinode rather than latest, because a latest tag would pull it into
    every variant selecting .latest, and it runs on rhel88 only.

  • scripts/create-repl-set.sh - the node count comes from REPLSET_NODES,
    defaulting to 1, so the existing single-node callers are unaffected.

    With more than one node, the set is initiated with priority = 2 on member 0.
    Everything in CI connects to localhost:${mongod_port}, which is the set's
    first node, so that node has to be the primary; without this, an election that
    picks any other node fails every write in the integration suite, not just the
    multi-node tests. Verified locally that a three-node set does elect another
    node when nothing biases the config.

  • scripts/wait-for-cluster.sh - with more than one node, also waits for the node
    behind MONGOD_PORT to report ismaster. Waiting only for the port to accept
    connections lets tests start while the election is still in progress.

This was referenced Aug 20, 2026

autarch commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

Adds a test type and a CI task for tests that need more than one data-bearing
node: a secondary to connect to, or a write concern greater than w:1. No tests
use it yet; the conversions that do follow in later commits.

- `common/testtype/types.go` - adds `MultiNodeReplSetTestType`
  (`TOOLS_TESTING_MULTINODE_REPLSET`). Additive to `common/`, so no API change,
  but `common/` is used by other projects at MongoDB.

- `buildscript/build.go` - `-topology=multiNodeReplSet` sets both
  `TOOLS_TESTING_REPLSET` and `TOOLS_TESTING_MULTINODE_REPLSET`, since a
  three-node set satisfies the single-node replica set tests too.

- `common.yml` - adds the `integration-multinode-latest` task, modeled on
  `integration-latest-cluster`: the latest server, a three-node set, TLS, and
  `test:integration -ssl=true -topology=multiNodeReplSet`. It is tagged
  `multinode` rather than `latest`, because a `latest` tag would pull it into
  every variant selecting `.latest`, and it runs on `rhel88` only.

- `scripts/create-repl-set.sh` - the node count comes from `REPLSET_NODES`,
  defaulting to 1, so the existing single-node callers are unaffected.

  With more than one node, the set is initiated with `priority = 2` on member 0.
  Everything in CI connects to `localhost:${mongod_port}`, which is the set's
  first node, so that node has to be the primary; without this, an election that
  picks any other node fails every write in the integration suite, not just the
  multi-node tests. Verified locally that a three-node set does elect another
  node when nothing biases the config.

- `scripts/wait-for-cluster.sh` - with more than one node, also waits for the node
  behind `MONGOD_PORT` to report `ismaster`. Waiting only for the port to accept
  connections lets tests start while the election is still in progress.
@autarch
autarch force-pushed the 08-17-tools-4263_convert_the_system_ca_tls_test_to_go branch from d959b7e to 867d660 Compare August 25, 2026 20:18
@autarch
autarch force-pushed the 08-17-tools-4263_add_multi_node_replica_set_test_infrastructure branch from 0fff3fe to 23e1e6a Compare August 25, 2026 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant