DRIVERS-3006 Consolidate CSOT change stream timeout tests#1888
Open
prestonvasquez wants to merge 1 commit intomongodb:masterfrom
Open
Conversation
Combine "change stream can be iterated again if previous iteration
times out" and "timeoutMS is refreshed for next call after a timeout error" into
a single test that validates both spec requirements:
- [resumption] If a next call fails with a timeout error, drivers MUST
NOT invalidate the change stream. The subsequent next call MUST perform
a resume attempt to establish a new change stream on the server.
- [refresh] If a resume is required for a next call on a change
stream, the timeout MUST apply to the entirety of the initial getMore and all
commands sent as part of the resume attempt.
The new test blocks the resume aggregate for 150ms to prove the
timeout is refreshed (a fresh 200ms budget, not exhausted from the previous
call).
Member
Author
|
@dariakp A member of the Node Driver team reported DRIVERES-3006, would someone from that team like to review the summary and validate the suggested UST updates? |
Contributor
|
sync-ed the test changed to node: mongodb/node-mongodb-native#4872 - alas, no free lunch, we have an extra command started event, someone from the node team is going to take a closer look |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
DRIVERS-3006
Please complete the following before merging:
clusters).
Summary
The DRIVERS ticket reports a contradiction in the following two requirements from specifications:
[1] If a next call fails with a timeout error, drivers MUST NOT invalidate the change stream. The subsequent next call MUST perform a resume attempt to establish a new change stream on the server.
[2] If a resume is required for a next call on a change stream, the timeout MUST apply to the entirety of the initial getMore and all commands sent as part of the resume attempt.
While there appears to be no contradiction, the CSOT change stream test in question should be extended to include case [2].
Go Driver Implementation
Notably, the Go Driver skips this test:
GODRIVER-3380 provides a non-UST repro, you can run it directly here. As noted in the ticket, the fix for this is fairly straightforward in the Go Driver. In our case, [1] is just checking that we don’t invalidate on a timeout error [not current behavior]:
However, even if we made this change, the unified spec test responsible for testing this would still fail since it would be an anti-pattern in Go to use the deadline for a context passed to collection.Watch() for each call to collection.Next(), which is an implicit [at least] requirement of both the specs (see above) and the unified spec test in question:
This commit implements the following acceptance criteria from GODRIVER-3480 required to test the changes:
prestonvasquez/mongo-go-driver@808463a