Skip to content

test(NODE-7458): sync server selection deprioritization tag spec tests#4886

Merged
dariakp merged 1 commit intomainfrom
NODE-7458/deprioritized-tag-set-tests
Mar 10, 2026
Merged

test(NODE-7458): sync server selection deprioritization tag spec tests#4886
dariakp merged 1 commit intomainfrom
NODE-7458/deprioritized-tag-set-tests

Conversation

@dariakp
Copy link
Copy Markdown
Contributor

@dariakp dariakp commented Mar 9, 2026

Description

NODE-7458

Summary of Changes

Sync server-selection tag tests for ReplicaSetNoPrimary and ReplicaSetWithPrimary

Double check the following

  • Lint is passing (npm run check:lint)
  • Self-review completed using the steps outlined here
  • PR title follows the correct format: type(NODE-xxxx)[!]: description
    • Example: feat(NODE-1234)!: rewriting everything in coffeescript
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

@dariakp dariakp marked this pull request as ready for review March 10, 2026 14:50
@dariakp dariakp requested a review from a team as a code owner March 10, 2026 14:50
Copilot AI review requested due to automatic review settings March 10, 2026 14:50
@dariakp
Copy link
Copy Markdown
Contributor Author

dariakp commented Mar 10, 2026

CI failures are unrelated

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR syncs server-selection “deprioritized server” tag-set spec tests for ReplicaSetWithPrimary and ReplicaSetNoPrimary topologies, aligning the Node driver’s spec fixture set with the upstream coverage for “only matching tags” scenarios.

Changes:

  • Added “OnlyMatchingTags” server selection logic fixtures for ReplicaSetWithPrimary read preferences (Nearest/Secondary/SecondaryPreferred/PrimaryPreferred).
  • Added corresponding “OnlyMatchingTags” fixtures for ReplicaSetNoPrimary read preferences (Nearest/Secondary/SecondaryPreferred/PrimaryPreferred).
  • Provided both YAML and JSON representations for each new scenario (consistent with existing spec fixture patterns in this repo).

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.

Show a summary per file
File Description
test/spec/server-selection/server_selection/ReplicaSetWithPrimary/read/DeprioritizedSecondaryPreferredOnlyMatchingTags.yml Adds YAML fixture for SecondaryPreferred where only tag-matching secondary is deprioritized (primary fallback).
test/spec/server-selection/server_selection/ReplicaSetWithPrimary/read/DeprioritizedSecondaryPreferredOnlyMatchingTags.json JSON version of the above fixture (used by Node’s spec runner).
test/spec/server-selection/server_selection/ReplicaSetWithPrimary/read/DeprioritizedSecondaryOnlyMatchingTags.yml Adds YAML fixture for Secondary where only tag-matching secondary is deprioritized (must still be selected).
test/spec/server-selection/server_selection/ReplicaSetWithPrimary/read/DeprioritizedSecondaryOnlyMatchingTags.json JSON version of the above fixture.
test/spec/server-selection/server_selection/ReplicaSetWithPrimary/read/DeprioritizedPrimaryPreferredOnlyMatchingTags.yml Adds YAML regression fixture for PrimaryPreferred where the matching primary is deprioritized but must still be selected.
test/spec/server-selection/server_selection/ReplicaSetWithPrimary/read/DeprioritizedPrimaryPreferredOnlyMatchingTags.json JSON version of the above fixture.
test/spec/server-selection/server_selection/ReplicaSetWithPrimary/read/DeprioritizedNearestOnlyMatchingTags.yml Adds YAML fixture for Nearest where only tag-matching server is deprioritized (must still be selected).
test/spec/server-selection/server_selection/ReplicaSetWithPrimary/read/DeprioritizedNearestOnlyMatchingTags.json JSON version of the above fixture.
test/spec/server-selection/server_selection/ReplicaSetNoPrimary/read/DeprioritizedSecondaryPreferredOnlyMatchingTags.yml Adds YAML fixture for SecondaryPreferred in a no-primary topology where only tag-matching secondary is deprioritized.
test/spec/server-selection/server_selection/ReplicaSetNoPrimary/read/DeprioritizedSecondaryPreferredOnlyMatchingTags.json JSON version of the above fixture.
test/spec/server-selection/server_selection/ReplicaSetNoPrimary/read/DeprioritizedSecondaryOnlyMatchingTags.yml Adds YAML fixture for Secondary where only tag-matching secondary is deprioritized.
test/spec/server-selection/server_selection/ReplicaSetNoPrimary/read/DeprioritizedSecondaryOnlyMatchingTags.json JSON version of the above fixture.
test/spec/server-selection/server_selection/ReplicaSetNoPrimary/read/DeprioritizedPrimaryPreferredOnlyMatchingTags.yml Adds YAML fixture for PrimaryPreferred in a no-primary topology where only tag-matching secondary is deprioritized.
test/spec/server-selection/server_selection/ReplicaSetNoPrimary/read/DeprioritizedPrimaryPreferredOnlyMatchingTags.json JSON version of the above fixture.
test/spec/server-selection/server_selection/ReplicaSetNoPrimary/read/DeprioritizedNearestOnlyMatchingTags.yml Adds YAML fixture for Nearest in a no-primary topology where only tag-matching secondary is deprioritized.
test/spec/server-selection/server_selection/ReplicaSetNoPrimary/read/DeprioritizedNearestOnlyMatchingTags.json JSON version of the above fixture.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@nbbeeken nbbeeken self-assigned this Mar 10, 2026
@nbbeeken nbbeeken added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Mar 10, 2026
@dariakp dariakp merged commit aa8b39c into main Mar 10, 2026
34 checks passed
@dariakp dariakp deleted the NODE-7458/deprioritized-tag-set-tests branch March 10, 2026 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Primary Review In Review with primary reviewer, not yet ready for team's eyes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants