DRIVERS-2797 Check for substring in Index Management error asserts #1485
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Check for substring in Index Management error asserts
Background & Motivation
Atlas Search Index specification tests expect an error returned from a non-Atlas server. Example:
SERVER-83290 changed the error message from:
to:
The message change causes this test to fail in driver tests with latest server builds.
This PR proposes using "Atlas" as a common substring in both errors.
Updated tests were verified in C driver:
https://spruce.mongodb.com/version/6581c5d12a60ed6df70bbe25
Rejected alternatives
Checking the server error code was considered as an alternative. The returned errorCode also appears to have changed.
Please complete the following before merging:
[ ] Update changelog.N/A.[] Test these changes against all server versions and topologies (including standalone, replica set, sharded clusters, and serverless).Tested with replica set and sharded cluster. Tests are not run in C driver load balancer tasks