-
Notifications
You must be signed in to change notification settings - Fork 532
RUBY-2682 RUBY-2443 test that driver closes cursors left open by server when result set is fully iterated #2378
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
Conversation
lib/mongo/protocol/msg.rb
Outdated
end | ||
end | ||
end | ||
0 |
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.
What would happen if this line instead raised NotImplementedError
?
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 just started a patch with this, I'll let you know what the results are: Evergreen Patch
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.
There are a lot of failures at this test:
1) Mongo::Collection::View::MapReduce#each when the view has a limit applies the limit to the map/reduce
Failure/Error: raise NotImplementedError
NotImplementedError:
NotImplementedError
# ./lib/mongo/protocol/msg.rb:309:in `number_returned'
# ./lib/mongo/operation/result.rb:252:in `returned_count'
# ./lib/mongo/cursor.rb:439:in `process'
# ./lib/mongo/cursor.rb:206:in `try_next'
# ./lib/mongo/cursor.rb:169:in `block in each'
# ./lib/mongo/cursor.rb:168:in `loop'
# ./lib/mongo/cursor.rb:168:in `each'
# ./lib/mongo/collection/view/map_reduce.rb:79:in `each'
# ./spec/mongo/collection/view/map_reduce_spec.rb:427:in `block (4 levels) in <top (required)>'
# ./spec/lite_spec_helper.rb:131:in `block (3 levels) in <top (required)>'
# ./spec/lite_spec_helper.rb:130:in `block (2 levels) in <top (required)>'
# ./spec/lite_spec_helper.rb:113:in `block (2 levels) in <top (required)>'
# ./spec/support/background_thread_registry.rb:65:in `block (2 levels) in <top (required)>'
lib/mongo/protocol/message.rb
Outdated
@@ -326,7 +326,7 @@ def set_request_id | |||
# @return [ 0 ] This method must be overridden, otherwise, always returns 0. | |||
# | |||
# @since 2.5.0 | |||
def number_returned; 0; end | |||
def number_returned; raise NotImplementedError; end |
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.
This line is causing a bunch of failures. Reverting back to its original state.
lib/mongo/protocol/msg.rb
Outdated
end | ||
end | ||
end | ||
0 |
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 also changed this line to return 0 instead of raising an exception, for consistency.
@@ -69,8 +69,7 @@ tests: | |||
command: | |||
getMore: { $$type: [ int, long ] } | |||
collection: *collection0Name | |||
# https://jira.mongodb.org/browse/RUBY-2443 | |||
batchSize: 3 | |||
batchSize: 1 |
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.
This test was not consistent with the specs because of how we implemented number_returned
. Now that we changed the implementation of it, we can change this to be consistent with the spec tests.
Additionally, it seems that RUBY-2443 can be closed as fixed from this PR. Although, I'm not sure we implemented number_returned exactly how that ticket suggested. (Although, they also seem to default to 0)
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.
No description provided.