-
Notifications
You must be signed in to change notification settings - Fork 1.5k
JAVA-4320 fix server selection flaky test #1847
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
This PR suggests we should change the corresponding specification prose test https://github.com/mongodb/specifications/blob/master/source/server-selection/server-selection-tests.md#prose-test. I don't think Node should have just silently deviated from the spec. |
@stIncMale thanks for the feedback, I noticed that dotnet driver doesn't experience flakiness with 10% deviation, the only difference I saw is the threshold value
So I updated the PR to have 10% deviation and increased threshold |
| MongoClientSettings clientSettings = getMongoClientSettingsBuilder() | ||
| .applicationName(appName) | ||
| .applyConnectionString(multiMongosConnectionString) | ||
| // set it to 3000 ms according to specification |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit] The comment can give the impression that only this setting is spec-compliant, while the rest might not be. Should we remove this one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of removing the comment, let's update it to explain the full story:
- our default
localThresholdvalue is 15 ms, which deviates from the default value 3000 ms required by the specification; - such a small
localThresholddisrupts server selection in this probabilistic test enough to make it fail noticeably often.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the comment as was mentioned by @stIncMale
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1. Could we please make the comment to look like correct English: proper use of capital letters, periods at the end of sentences?
2. We actually do not need the comment because my proposal was based on an incorrect understanding. I thought, you mean that the Java driver deviates from the spec, which requires the default localThreshold to be 3000 ms. But that is not the case, the spec requires 15 ms, which is our default, that is, we are compliant. It's the prose test that requires setting localThreshold to 30000 ms (not 3000 ms!), which we did not set. So let's update the test code accordingly, and remove the comment, as it is not needed at all.
stIncMale
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.
JAVA-4320
1. increase the number of operations to 1000 as in NodeJs2. increase the deviation to 15% as in NodeJsIncreased local threshold to 3 seconds