Skip to content

chore: skip csfle tests and fix related broken tests#4965

Open
PavelSafronov wants to merge 6 commits into
mainfrom
csfle-tests-fix
Open

chore: skip csfle tests and fix related broken tests#4965
PavelSafronov wants to merge 6 commits into
mainfrom
csfle-tests-fix

Conversation

@PavelSafronov

@PavelSafronov PavelSafronov commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Description

Summary of Changes

This skips some CSFLE tests against 9.0+, which are currently failing due to https://jira.mongodb.org/browse/SERVER-91887 and https://jira.mongodb.org/browse/DRIVERS-3547

What is the motivation for this change?

Failing tests, caused by a 9.0 server change.

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

@PavelSafronov PavelSafronov changed the title correct spec test skip csfle tests Jun 17, 2026
@PavelSafronov PavelSafronov changed the title skip csfle tests Skip csfle tests and fix broken tests Jun 17, 2026
@PavelSafronov PavelSafronov changed the title Skip csfle tests and fix broken tests chore: skip csfle tests and fix related broken tests Jun 17, 2026
@PavelSafronov PavelSafronov marked this pull request as ready for review June 17, 2026 22:11
@PavelSafronov PavelSafronov requested a review from a team as a code owner June 17, 2026 22:11
Copilot AI review requested due to automatic review settings June 17, 2026 22:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 updates the Node.js driver’s CSFLE integration/prose test suite to avoid known MongoDB Server 9.0+ failures by conditionally skipping affected tests based on server version.

Changes:

  • Add server-version-based skips for specific FLE2v2 spec tests that fail due to SERVER-91887.
  • Restrict certain prose test cases to run only on pre-9.0 servers to avoid known contentionFactor validation failures.
  • Fix range explicit encryption prose tests to query the correct dynamic encrypted${dataType} field names.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.

File Description
test/integration/client-side-encryption/client_side_encryption.spec.test.ts Adds semver-gated skips for failing legacy/unified CSFLE spec tests on MongoDB 9.0+
test/integration/client-side-encryption/client_side_encryption.prose.test.ts Introduces pre-9.0 metadata to skip a contentionFactor-mismatch prose case on 9.0+
test/integration/client-side-encryption/client_side_encryption.prose.27.text_queries.test.ts Tightens metadata to exclude MongoDB 9.0+ where text preview features / contention validation break tests
test/integration/client-side-encryption/client_side_encryption.prose.22.range_explicit_encryption.test.ts Fixes queries to use computed encrypted${dataType} field names instead of a placeholder string

// exceeds the collection's configured contention; SERVER-91887 now validates this on 9.0+.
if (
description === 'BypassQueryAnalysis decrypts' &&
semver.satisfies(configuration.version, '>=9.0.0')

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

False positive: that's not how our version filter works, the version 9.0.0-rc0 is seen as 9.0.0 by the tests.
Code: https://github.com/mongodb/node-mongodb-native/blob/csfle-tests-fix/test/tools/runner/filters/mongodb_version_filter.ts#L32

// configured with contention:0, but libmongocrypt generates random contentionFactor values.
// SERVER-91887 now rejects payloads whose contentionFactor exceeds configured contention on 9.0+.
if (
semver.satisfies(configuration.version, '>=9.0.0') &&

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

False positive

// exceeds the collection's configured contention; SERVER-91887 now validates this on 9.0+.
if (
description === 'BypassQueryAnalysis decrypts' &&
semver.satisfies(configuration.version, '>=9.0.0')

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

False positive

// that exceeds contention:0 on 9.0+ (SERVER-91887).
if (
description === 'encryptedFieldsMap is preferred over remote encryptedFields' &&
semver.satisfies(configuration.version, '>=9.0.0')

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

False positive

const eeMetadataPre90: MongoDBMetadataUI = {
requires: {
clientSideEncryption: true,
mongodb: '>=7.0.0 <9.0.0',

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

False positive

requires: {
clientSideEncryption: '>=6.4.0',
mongodb: '>=8.2.0',
mongodb: '>=8.2.0 <9.0.0',

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

False positive

const metadataWithoutSubstringPreview: MongoDBMetadataUI = {
requires: {
clientSideEncryption: '>=6.4.0',
mongodb: '>=8.2.0 <9.0.0',

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

False positive

@tadjik1 tadjik1 self-assigned this Jun 18, 2026
@tadjik1 tadjik1 added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Jun 18, 2026
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