Skip to content

PYTHON-5884 Explicit Encryption prose test "Case 2" fails on latest server: payload contentionFactor exceeds collection's configured contention - #3034

Open
sleepyStick wants to merge 4 commits into
mongodb:mainfrom
sleepyStick:PYTHON-5884
Open

PYTHON-5884 Explicit Encryption prose test "Case 2" fails on latest server: payload contentionFactor exceeds collection's configured contention#3034
sleepyStick wants to merge 4 commits into
mongodb:mainfrom
sleepyStick:PYTHON-5884

Conversation

@sleepyStick

@sleepyStick sleepyStick commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

PYTHON-5884

Changes in this PR

fix the prose test

Test Plan

passing evergreen patch for encryption variants: https://spruce.corp.mongodb.com/version/6a97355c960c270007693694/tasks?sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC

Checklist

Checklist for Author

  • [NA] Did you update the changelog (if necessary)?
  • Is there test coverage?
  • [NA] Is any followup work tracked in a JIRA ticket? If so, add link(s).

Checklist for Reviewer

  • Does the title of the PR reference a JIRA Ticket?
  • Do you fully understand the implementation? (Would you be comfortable explaining how this code works to someone else?)
  • Is all relevant documentation (README or docstring) updated?

@sleepyStick
sleepyStick marked this pull request as ready for review September 1, 2026 21:52
@sleepyStick
sleepyStick requested a review from a team as a code owner September 1, 2026 21:52
@sleepyStick
sleepyStick requested review from blink1073 and a lite review from Copilot September 1, 2026 21:52
@sleepyStick sleepyStick changed the title PYTHON-5884 PYTHON-5884 Explicit Encryption prose test "Case 2" fails on latest server: payload contentionFactor exceeds collection's configured contention Sep 1, 2026

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.

🟡 Changes recommended

The setup currently drops an unrelated database (explicit_encryption_c10) even though the test creates/uses a collection of that name in test_queryable_encryption, which can cause unintended side effects (especially under parallel test execution).

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Updates the explicit queryable encryption prose tests to align collection encryptedFields configuration with the contention_factor=10 payloads expected by “Case 2” on newer server versions, avoiding failures where the payload contention exceeds the collection’s configured contention.

Changes:

  • Add a second explicit encryption collection configured with contention=10 using encryptedFields-c10.json.
  • Update the contention prose test to insert/find against the new explicit_encryption_c10 collection (sync + async).
File summaries
File Description
test/test_encryption.py Creates a contention=10 QE collection and updates the contention prose test to use it (sync).
test/asynchronous/test_encryption.py Same as above for the async test suite.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread test/asynchronous/test_encryption.py Outdated
"create", "explicit_encryption", encryptedFields=self.encrypted_fields
)
self.encrypted_fields_c10 = json_data("etc", "data", "encryptedFields-c10.json")
await self.client.drop_database(self.client.explicit_encryption_c10)
Comment thread test/test_encryption.py Outdated
self.client.drop_database(self.db)
self.db.command("create", "explicit_encryption", encryptedFields=self.encrypted_fields)
self.encrypted_fields_c10 = json_data("etc", "data", "encryptedFields-c10.json")
self.client.drop_database(self.client.explicit_encryption_c10)
@codecov

codecov Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@blink1073 blink1073 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

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.

3 participants