mongo 2.11.0.rc0 → 2.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/Rakefile +2 -0
- data/lib/mongo/auth.rb +11 -2
- data/lib/mongo/auth/cr/conversation.rb +1 -1
- data/lib/mongo/auth/ldap/conversation.rb +1 -1
- data/lib/mongo/auth/scram/conversation.rb +4 -1
- data/lib/mongo/auth/user.rb +15 -1
- data/lib/mongo/auth/user/view.rb +10 -4
- data/lib/mongo/auth/x509.rb +11 -1
- data/lib/mongo/auth/x509/conversation.rb +15 -6
- data/lib/mongo/background_thread.rb +28 -13
- data/lib/mongo/client.rb +23 -15
- data/lib/mongo/collection/view/change_stream.rb +5 -1
- data/lib/mongo/collection/view/readable.rb +5 -2
- data/lib/mongo/collection/view/writable.rb +3 -1
- data/lib/mongo/cursor/builder/get_more_command.rb +4 -1
- data/lib/mongo/cursor/builder/kill_cursors_command.rb +16 -5
- data/lib/mongo/cursor/builder/op_get_more.rb +2 -2
- data/lib/mongo/cursor/builder/op_kill_cursors.rb +17 -5
- data/lib/mongo/error/operation_failure.rb +3 -3
- data/lib/mongo/monitoring/command_log_subscriber.rb +5 -3
- data/lib/mongo/monitoring/event/command_started.rb +13 -3
- data/lib/mongo/monitoring/publishable.rb +4 -2
- data/lib/mongo/operation/create_user/command.rb +1 -0
- data/lib/mongo/operation/remove_user/command.rb +1 -0
- data/lib/mongo/operation/update_user/command.rb +1 -0
- data/lib/mongo/protocol/get_more.rb +2 -1
- data/lib/mongo/protocol/kill_cursors.rb +6 -13
- data/lib/mongo/protocol/serializers.rb +10 -4
- data/lib/mongo/retryable.rb +1 -1
- data/lib/mongo/server/connection.rb +6 -2
- data/lib/mongo/server/connection_base.rb +2 -1
- data/lib/mongo/server/monitor.rb +1 -1
- data/lib/mongo/server/pending_connection.rb +6 -0
- data/lib/mongo/socket/ssl.rb +1 -1
- data/lib/mongo/uri.rb +5 -41
- data/lib/mongo/version.rb +1 -1
- data/mongo.gemspec +11 -2
- data/spec/README.md +105 -9
- data/spec/USERS.md +72 -0
- data/spec/integration/auth_spec.rb +20 -6
- data/spec/integration/client_construction_spec.rb +3 -1
- data/spec/integration/client_options_spec.rb +437 -0
- data/spec/integration/command_monitoring_spec.rb +4 -1
- data/spec/integration/connection_pool_populator_spec.rb +4 -0
- data/spec/integration/connection_spec.rb +4 -2
- data/spec/integration/cursor_reaping_spec.rb +1 -1
- data/spec/integration/get_more_spec.rb +32 -0
- data/spec/integration/retryable_errors_spec.rb +99 -0
- data/spec/integration/retryable_writes_errors_spec.rb +11 -10
- data/spec/lite_spec_helper.rb +2 -1
- data/spec/mongo/auth/scram_spec.rb +1 -0
- data/spec/mongo/auth/user/view_spec.rb +102 -1
- data/spec/mongo/auth/user_spec.rb +56 -15
- data/spec/mongo/auth/x509_spec.rb +31 -1
- data/spec/mongo/bulk_write_spec.rb +2 -2
- data/spec/mongo/collection/view/change_stream_spec.rb +2 -2
- data/spec/mongo/collection/view/readable_spec.rb +8 -4
- data/spec/mongo/cursor/builder/get_more_command_spec.rb +4 -2
- data/spec/mongo/cursor/builder/op_get_more_spec.rb +4 -2
- data/spec/mongo/cursor_spec.rb +3 -3
- data/spec/mongo/retryable_spec.rb +31 -52
- data/spec/mongo/server/connection_auth_spec.rb +3 -0
- data/spec/mongo/server/connection_pool_spec.rb +4 -0
- data/spec/mongo/server/connection_spec.rb +12 -4
- data/spec/mongo/server/monitor_spec.rb +19 -1
- data/spec/mongo/socket/ssl_spec.rb +1 -1
- data/spec/mongo/uri/srv_protocol_spec.rb +0 -13
- data/spec/mongo/uri_option_parsing_spec.rb +0 -8
- data/spec/mongo/uri_spec.rb +6 -20
- data/spec/runners/connection_string.rb +116 -0
- data/spec/runners/read_write_concern_document.rb +67 -0
- data/spec/spec_tests/change_streams_spec.rb +17 -2
- data/spec/spec_tests/connection_string_spec.rb +2 -59
- data/spec/spec_tests/data/change_streams/change-streams-errors.yml +3 -3
- data/spec/spec_tests/data/change_streams/change-streams.yml +88 -20
- data/spec/spec_tests/data/cmap/connection-must-have-id.yml +6 -0
- data/spec/spec_tests/data/cmap/connection-must-order-ids.yml +6 -0
- data/spec/spec_tests/data/cmap/pool-checkin-destroy-closed.yml +3 -0
- data/spec/spec_tests/data/cmap/pool-checkin-destroy-stale.yml +3 -0
- data/spec/spec_tests/data/cmap/pool-checkin-make-available.yml +3 -0
- data/spec/spec_tests/data/cmap/pool-checkin.yml +1 -0
- data/spec/spec_tests/data/cmap/pool-checkout-connection.yml +2 -0
- data/spec/spec_tests/data/cmap/pool-checkout-error-closed.yml +5 -0
- data/spec/spec_tests/data/cmap/pool-checkout-multiple.yml +3 -0
- data/spec/spec_tests/data/cmap/pool-checkout-no-idle.yml +4 -0
- data/spec/spec_tests/data/cmap/pool-checkout-no-stale.yml +4 -0
- data/spec/spec_tests/data/cmap/pool-close-destroy-conns.yml +2 -0
- data/spec/spec_tests/data/cmap/pool-create-max-size.yml +15 -0
- data/spec/spec_tests/data/cmap/pool-create-min-size.yml +4 -0
- data/spec/spec_tests/data/cmap/wait-queue-fairness.yml +31 -1
- data/spec/spec_tests/data/cmap/wait-queue-timeout.yml +5 -0
- data/spec/spec_tests/data/read_write_concern/connection-string/read-concern.yml +32 -0
- data/spec/spec_tests/data/read_write_concern/connection-string/write-concern.yml +82 -0
- data/spec/spec_tests/data/read_write_concern/document/read-concern.yml +37 -0
- data/spec/spec_tests/data/read_write_concern/document/write-concern.yml +100 -0
- data/spec/spec_tests/data/retryable_reads/aggregate-merge.yml +39 -0
- data/spec/spec_tests/data/retryable_reads/aggregate-serverErrors.yml +1 -1
- data/spec/spec_tests/data/retryable_reads/changeStreams-client.watch-serverErrors.yml +2 -2
- data/spec/spec_tests/data/retryable_reads/changeStreams-client.watch.yml +1 -1
- data/spec/spec_tests/data/retryable_reads/changeStreams-db.coll.watch-serverErrors.yml +2 -2
- data/spec/spec_tests/data/retryable_reads/changeStreams-db.coll.watch.yml +1 -1
- data/spec/spec_tests/data/retryable_reads/changeStreams-db.watch-serverErrors.yml +2 -2
- data/spec/spec_tests/data/retryable_reads/changeStreams-db.watch.yml +1 -1
- data/spec/spec_tests/data/retryable_reads/count-serverErrors.yml +1 -1
- data/spec/spec_tests/data/retryable_reads/countDocuments-serverErrors.yml +1 -1
- data/spec/spec_tests/data/retryable_reads/distinct-serverErrors.yml +1 -1
- data/spec/spec_tests/data/retryable_reads/estimatedDocumentCount-serverErrors.yml +1 -1
- data/spec/spec_tests/data/retryable_reads/find-serverErrors.yml +1 -1
- data/spec/spec_tests/data/retryable_reads/findOne-serverErrors.yml +1 -1
- data/spec/spec_tests/data/retryable_reads/gridfs-download-serverErrors.yml +1 -1
- data/spec/spec_tests/data/retryable_reads/gridfs-downloadByName-serverErrors.yml +1 -1
- data/spec/spec_tests/data/retryable_reads/listCollectionNames-serverErrors.yml +1 -1
- data/spec/spec_tests/data/retryable_reads/listCollectionObjects-serverErrors.yml +1 -1
- data/spec/spec_tests/data/retryable_reads/listCollections-serverErrors.yml +1 -1
- data/spec/spec_tests/data/retryable_reads/listDatabaseNames-serverErrors.yml +1 -1
- data/spec/spec_tests/data/retryable_reads/listDatabaseObjects-serverErrors.yml +1 -1
- data/spec/spec_tests/data/retryable_reads/listDatabases-serverErrors.yml +1 -1
- data/spec/spec_tests/data/retryable_reads/listIndexNames-serverErrors.yml +1 -1
- data/spec/spec_tests/data/retryable_reads/listIndexes-serverErrors.yml +1 -1
- data/spec/spec_tests/data/transactions/read-concern.yml +6 -6
- data/spec/spec_tests/data/transactions/transaction-options-repl.yml +117 -0
- data/spec/spec_tests/data/transactions/transaction-options.yml +14 -121
- data/spec/spec_tests/data/transactions/write-concern.yml +3 -0
- data/spec/spec_tests/data/transactions_api/transaction-options.yml +11 -12
- data/spec/spec_tests/dns_seedlist_discovery_spec.rb +17 -7
- data/spec/spec_tests/read_write_concern_connection_string_spec.rb +8 -0
- data/spec/spec_tests/read_write_concern_document_spec.rb +74 -0
- data/spec/spec_tests/retryable_reads_spec.rb +32 -1
- data/spec/spec_tests/uri_options_spec.rb +4 -2
- data/spec/support/auth.rb +5 -14
- data/spec/support/certificates/client-x509.crt +78 -0
- data/spec/support/certificates/client-x509.key +27 -0
- data/spec/support/certificates/client-x509.pem +105 -0
- data/spec/support/change_streams.rb +8 -11
- data/spec/support/client_registry.rb +26 -12
- data/spec/support/cluster_tools.rb +2 -2
- data/spec/support/cmap.rb +11 -7
- data/spec/support/command_monitoring.rb +8 -8
- data/spec/support/connection_string.rb +56 -28
- data/spec/support/constraints.rb +8 -0
- data/spec/support/crud/spec.rb +5 -8
- data/spec/support/event_subscriber.rb +7 -0
- data/spec/support/gridfs.rb +4 -7
- data/spec/support/server_discovery_and_monitoring.rb +3 -8
- data/spec/support/server_selection.rb +4 -9
- data/spec/support/server_selection_rtt.rb +4 -7
- data/spec/support/spec_config.rb +47 -19
- data/spec/support/spec_setup.rb +5 -0
- data/spec/support/utils.rb +46 -8
- metadata +637 -597
- metadata.gz.sig +0 -0
@@ -0,0 +1,116 @@
|
|
1
|
+
|
2
|
+
def define_connection_string_spec_tests(test_paths, spec_cls = Mongo::ConnectionString::Spec, &block)
|
3
|
+
|
4
|
+
clean_slate_for_all
|
5
|
+
|
6
|
+
test_paths.each do |path|
|
7
|
+
|
8
|
+
spec = spec_cls.new(path)
|
9
|
+
|
10
|
+
context(spec.description) do
|
11
|
+
|
12
|
+
#include Mongo::ConnectionString
|
13
|
+
|
14
|
+
spec.tests.each_with_index do |test, index|
|
15
|
+
context "when a #{test.description} is provided" do
|
16
|
+
if test.description.downcase.include?("gssapi")
|
17
|
+
require_mongo_kerberos
|
18
|
+
end
|
19
|
+
|
20
|
+
context 'when the uri is invalid', unless: test.valid? do
|
21
|
+
|
22
|
+
it 'raises an error' do
|
23
|
+
expect{
|
24
|
+
test.uri
|
25
|
+
}.to raise_exception(Mongo::Error::InvalidURI)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
context 'when the uri should warn', if: test.warn? do
|
30
|
+
|
31
|
+
before do
|
32
|
+
expect(Mongo::Logger.logger).to receive(:warn)
|
33
|
+
end
|
34
|
+
|
35
|
+
it 'warns' do
|
36
|
+
expect(test.client).to be_a(Mongo::Client)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
context 'when the uri is valid', if: test.valid? do
|
41
|
+
|
42
|
+
it 'does not raise an exception' do
|
43
|
+
expect(test.uri).to be_a(Mongo::URI)
|
44
|
+
end
|
45
|
+
|
46
|
+
it 'creates a client with the correct hosts' do
|
47
|
+
expect(test.client).to have_hosts(test, test.hosts)
|
48
|
+
end
|
49
|
+
|
50
|
+
it 'creates a client with the correct authentication properties' do
|
51
|
+
expect(test.client).to match_auth(test)
|
52
|
+
end
|
53
|
+
|
54
|
+
it 'creates a client with the correct options' do
|
55
|
+
expect(test.client).to match_options(test)
|
56
|
+
end
|
57
|
+
|
58
|
+
if test.read_concern_expectation
|
59
|
+
# Tests do not specify a read concern in the input and expect
|
60
|
+
# the read concern to be {); our non-specified read concern is nil.
|
61
|
+
# (But if a test used nil for the expectation, we wouldn't assert
|
62
|
+
# read concern at all.)
|
63
|
+
if test.read_concern_expectation == {}
|
64
|
+
it 'creates a client with no read concern' do
|
65
|
+
actual = Utils.camelize_hash(test.client.options[:read_concern])
|
66
|
+
expect(actual).to be nil
|
67
|
+
end
|
68
|
+
else
|
69
|
+
|
70
|
+
it 'creates a client with the correct read concern' do
|
71
|
+
actual = Utils.camelize_hash(test.client.options[:read_concern])
|
72
|
+
expect(actual).to eq(test.read_concern_expectation)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
if test.write_concern_expectation
|
78
|
+
let(:actual_write_concern) do
|
79
|
+
Utils.camelize_hash(test.client.options[:write_concern])
|
80
|
+
end
|
81
|
+
|
82
|
+
let(:expected_write_concern) do
|
83
|
+
test.write_concern_expectation.dup.tap do |expected|
|
84
|
+
# Spec tests have expectations on the "driver API" which is
|
85
|
+
# different from what is being sent to the server. In Ruby
|
86
|
+
# the "driver API" matches what we send to the server, thus
|
87
|
+
# these expectations are rather awkward to work with.
|
88
|
+
# Convert them all to expected server fields.
|
89
|
+
j = expected.delete('journal')
|
90
|
+
unless j.nil?
|
91
|
+
expected['j'] = j
|
92
|
+
end
|
93
|
+
wtimeout = expected.delete('wtimeoutMS')
|
94
|
+
unless wtimeout.nil?
|
95
|
+
expected['wtimeout'] = wtimeout
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
if test.write_concern_expectation == {}
|
101
|
+
|
102
|
+
it 'creates a client with no write concern' do
|
103
|
+
expect(actual_write_concern).to be nil
|
104
|
+
end
|
105
|
+
else
|
106
|
+
it 'creates a client with the correct write concern' do
|
107
|
+
expect(actual_write_concern).to eq(expected_write_concern)
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
module ReadWriteConcernDocument
|
2
|
+
|
3
|
+
class Spec
|
4
|
+
|
5
|
+
attr_reader :description
|
6
|
+
|
7
|
+
# Instantiate the new spec.
|
8
|
+
#
|
9
|
+
# @param [ String ] test_path The path to the file.
|
10
|
+
#
|
11
|
+
# @since 2.0.0
|
12
|
+
def initialize(test_path)
|
13
|
+
@spec = YAML.load(File.read(test_path))
|
14
|
+
@description = File.basename(test_path)
|
15
|
+
end
|
16
|
+
|
17
|
+
def tests
|
18
|
+
@tests ||= @spec['tests'].collect do |spec|
|
19
|
+
Test.new(spec)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
class Test
|
25
|
+
def initialize(spec)
|
26
|
+
@spec = spec
|
27
|
+
@description = @spec['description']
|
28
|
+
@uri_string = @spec['uri']
|
29
|
+
end
|
30
|
+
|
31
|
+
attr_reader :description
|
32
|
+
|
33
|
+
def valid?
|
34
|
+
!!@spec['valid']
|
35
|
+
end
|
36
|
+
|
37
|
+
def input_document
|
38
|
+
(@spec['readConcern'] || @spec['writeConcern']).tap do |concern|
|
39
|
+
# Documented Ruby API matches the server API, and Ruby prohibits
|
40
|
+
# journal key as used in the spec tests...
|
41
|
+
if concern.key?('journal')
|
42
|
+
concern['j'] = concern.delete('journal')
|
43
|
+
end
|
44
|
+
# ... and uses wtimeout instead of wtimeoutMS
|
45
|
+
if concern.key?('wtimeoutMS')
|
46
|
+
concern['wtimeout'] = concern.delete('wtimeoutMS')
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
def server_document
|
52
|
+
@spec['readConcernDocument'] || @spec['writeConcernDocument']
|
53
|
+
end
|
54
|
+
|
55
|
+
# Returns true, false or nil
|
56
|
+
def server_default?
|
57
|
+
# Do not convert to boolean
|
58
|
+
@spec['isServerDefault']
|
59
|
+
end
|
60
|
+
|
61
|
+
# Returns true, false or nil
|
62
|
+
def acknowledged?
|
63
|
+
# Do not convert to boolean
|
64
|
+
@spec['isAcknowledged']
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
@@ -26,12 +26,27 @@ describe 'ChangeStreams' do
|
|
26
26
|
test.run
|
27
27
|
end
|
28
28
|
|
29
|
+
let(:verifier) { Mongo::CRUD::Verifier.new(test) }
|
30
|
+
|
29
31
|
it 'returns the correct result' do
|
30
32
|
expect(result[:result]).to match_result(test)
|
31
33
|
end
|
32
34
|
|
33
|
-
|
34
|
-
|
35
|
+
if test.expectations
|
36
|
+
let(:actual_events) do
|
37
|
+
result[:events]
|
38
|
+
end
|
39
|
+
|
40
|
+
it 'has the correct number of command_started events' do
|
41
|
+
verifier.verify_command_started_event_count(test.expectations, actual_events)
|
42
|
+
end
|
43
|
+
|
44
|
+
test.expectations.each_with_index do |expectation, i|
|
45
|
+
it "has the correct command_started event #{i+1}" do
|
46
|
+
verifier.verify_command_started_event(
|
47
|
+
test.expectations, actual_events, i)
|
48
|
+
end
|
49
|
+
end
|
35
50
|
end
|
36
51
|
end
|
37
52
|
end
|
@@ -1,62 +1,5 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe '
|
4
|
-
|
5
|
-
|
6
|
-
clean_slate_for_all
|
7
|
-
|
8
|
-
CONNECTION_STRING_TESTS.each do |file|
|
9
|
-
|
10
|
-
spec = Mongo::ConnectionString::Spec.new(file)
|
11
|
-
|
12
|
-
context(spec.description) do
|
13
|
-
|
14
|
-
spec.tests.each_with_index do |test, index|
|
15
|
-
context "when a #{test.description} is provided" do
|
16
|
-
if test.description.downcase.include?("gssapi")
|
17
|
-
require_mongo_kerberos
|
18
|
-
end
|
19
|
-
|
20
|
-
context 'when the uri is invalid', unless: test.valid? do
|
21
|
-
|
22
|
-
it 'raises an error' do
|
23
|
-
expect{
|
24
|
-
test.uri
|
25
|
-
}.to raise_exception(Mongo::Error::InvalidURI)
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
context 'when the uri should warn', if: test.warn? do
|
30
|
-
|
31
|
-
before do
|
32
|
-
expect(Mongo::Logger.logger).to receive(:warn)
|
33
|
-
end
|
34
|
-
|
35
|
-
it 'warns' do
|
36
|
-
expect(test.client).to be_a(Mongo::Client)
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
context 'when the uri is valid', if: test.valid? do
|
41
|
-
|
42
|
-
it 'does not raise an exception' do
|
43
|
-
expect(test.uri).to be_a(Mongo::URI)
|
44
|
-
end
|
45
|
-
|
46
|
-
it 'creates a client with the correct hosts' do
|
47
|
-
expect(test.client).to have_hosts(test)
|
48
|
-
end
|
49
|
-
|
50
|
-
it 'creates a client with the correct authentication properties' do
|
51
|
-
expect(test.client).to match_auth(test)
|
52
|
-
end
|
53
|
-
|
54
|
-
it 'creates a client with the correct options' do
|
55
|
-
expect(test.client).to match_options(test)
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
3
|
+
describe 'Connection String' do
|
4
|
+
define_connection_string_spec_tests(CONNECTION_STRING_TESTS)
|
62
5
|
end
|
@@ -12,7 +12,8 @@ tests:
|
|
12
12
|
changeStreamPipeline: []
|
13
13
|
changeStreamOptions: {}
|
14
14
|
operations: []
|
15
|
-
|
15
|
+
# https://jira.mongodb.org/browse/SPEC-1462
|
16
|
+
expectations: ~
|
16
17
|
result:
|
17
18
|
error:
|
18
19
|
code: 40573
|
@@ -42,8 +43,7 @@ tests:
|
|
42
43
|
cursor: {}
|
43
44
|
pipeline:
|
44
45
|
-
|
45
|
-
$changeStream:
|
46
|
-
fullDocument: default
|
46
|
+
$changeStream: {}
|
47
47
|
-
|
48
48
|
$unsupported: foo
|
49
49
|
command_name: aggregate
|
@@ -27,8 +27,7 @@ tests:
|
|
27
27
|
cursor: {}
|
28
28
|
pipeline:
|
29
29
|
-
|
30
|
-
$changeStream:
|
31
|
-
fullDocument: default
|
30
|
+
$changeStream: {}
|
32
31
|
command_name: aggregate
|
33
32
|
database_name: *database_name
|
34
33
|
result:
|
@@ -59,7 +58,8 @@ tests:
|
|
59
58
|
arguments:
|
60
59
|
document:
|
61
60
|
x: 1
|
62
|
-
|
61
|
+
# https://jira.mongodb.org/browse/SPEC-1462
|
62
|
+
expectations: ~
|
63
63
|
result:
|
64
64
|
success:
|
65
65
|
-
|
@@ -110,8 +110,7 @@ tests:
|
|
110
110
|
cursor: {}
|
111
111
|
pipeline:
|
112
112
|
-
|
113
|
-
$changeStream:
|
114
|
-
fullDocument: default
|
113
|
+
$changeStream: {}
|
115
114
|
command_name: aggregate
|
116
115
|
database_name: *database_name
|
117
116
|
result:
|
@@ -158,12 +157,11 @@ tests:
|
|
158
157
|
cursor: {}
|
159
158
|
pipeline:
|
160
159
|
-
|
161
|
-
$changeStream:
|
162
|
-
fullDocument: default
|
160
|
+
$changeStream: {}
|
163
161
|
-
|
164
162
|
$match:
|
165
163
|
"fullDocument.z":
|
166
|
-
|
164
|
+
3
|
167
165
|
command_name: aggregate
|
168
166
|
database_name: *database_name
|
169
167
|
result:
|
@@ -175,7 +173,7 @@ tests:
|
|
175
173
|
coll: *collection_name
|
176
174
|
fullDocument:
|
177
175
|
z:
|
178
|
-
|
176
|
+
3
|
179
177
|
-
|
180
178
|
description: Executing a watch helper on a Database results in notifications for changes to all collections in the specified database.
|
181
179
|
minServerVersion: "3.8.0"
|
@@ -211,12 +209,11 @@ tests:
|
|
211
209
|
command_started_event:
|
212
210
|
command:
|
213
211
|
aggregate:
|
214
|
-
|
212
|
+
1
|
215
213
|
cursor: {}
|
216
214
|
pipeline:
|
217
215
|
-
|
218
|
-
$changeStream:
|
219
|
-
fullDocument: default
|
216
|
+
$changeStream: {}
|
220
217
|
command_name: aggregate
|
221
218
|
database_name: *database_name
|
222
219
|
result:
|
@@ -272,12 +269,11 @@ tests:
|
|
272
269
|
command_started_event:
|
273
270
|
command:
|
274
271
|
aggregate:
|
275
|
-
|
272
|
+
1
|
276
273
|
cursor: {}
|
277
274
|
pipeline:
|
278
275
|
-
|
279
276
|
$changeStream:
|
280
|
-
fullDocument: default
|
281
277
|
allChangesForCluster: true
|
282
278
|
command_name: aggregate
|
283
279
|
database_name: admin
|
@@ -357,8 +353,7 @@ tests:
|
|
357
353
|
cursor: {}
|
358
354
|
pipeline:
|
359
355
|
-
|
360
|
-
$changeStream:
|
361
|
-
fullDocument: default
|
356
|
+
$changeStream: {}
|
362
357
|
command_name: aggregate
|
363
358
|
database_name: *database_name
|
364
359
|
result:
|
@@ -416,8 +411,7 @@ tests:
|
|
416
411
|
cursor: {}
|
417
412
|
pipeline:
|
418
413
|
-
|
419
|
-
$changeStream:
|
420
|
-
fullDocument: default
|
414
|
+
$changeStream: {}
|
421
415
|
command_name: aggregate
|
422
416
|
database_name: *database_name
|
423
417
|
result:
|
@@ -453,8 +447,7 @@ tests:
|
|
453
447
|
cursor: {}
|
454
448
|
pipeline:
|
455
449
|
-
|
456
|
-
$changeStream:
|
457
|
-
fullDocument: default
|
450
|
+
$changeStream: {}
|
458
451
|
command_name: aggregate
|
459
452
|
database_name: *database_name
|
460
453
|
result:
|
@@ -466,3 +459,78 @@ tests:
|
|
466
459
|
coll: *collection_name
|
467
460
|
-
|
468
461
|
operationType: invalidate
|
462
|
+
# Test that resume logic works correctly even after consecutive retryable failures of a getMore command,
|
463
|
+
# with no intervening events. This is ensured by setting the batch size of the change stream to 1,
|
464
|
+
-
|
465
|
+
description: Test consecutive resume
|
466
|
+
minServerVersion: "4.1.7"
|
467
|
+
target: collection
|
468
|
+
topology:
|
469
|
+
- replicaset
|
470
|
+
changeStreamPipeline: []
|
471
|
+
changeStreamOptions: { batchSize: 1}
|
472
|
+
failPoint:
|
473
|
+
configureFailPoint: failCommand
|
474
|
+
mode: {times: 2}
|
475
|
+
data:
|
476
|
+
failCommands: ["getMore"]
|
477
|
+
closeConnection: true
|
478
|
+
operations:
|
479
|
+
-
|
480
|
+
database: *database_name
|
481
|
+
collection: *collection_name
|
482
|
+
name: insertOne
|
483
|
+
arguments:
|
484
|
+
document:
|
485
|
+
x: 1
|
486
|
+
-
|
487
|
+
database: *database_name
|
488
|
+
collection: *collection_name
|
489
|
+
name: insertOne
|
490
|
+
arguments:
|
491
|
+
document:
|
492
|
+
x: 2
|
493
|
+
-
|
494
|
+
database: *database_name
|
495
|
+
collection: *collection_name
|
496
|
+
name: insertOne
|
497
|
+
arguments:
|
498
|
+
document:
|
499
|
+
x: 3
|
500
|
+
expectations:
|
501
|
+
-
|
502
|
+
command_started_event:
|
503
|
+
command:
|
504
|
+
aggregate: *collection_name
|
505
|
+
cursor: {batchSize: 1}
|
506
|
+
pipeline:
|
507
|
+
-
|
508
|
+
$changeStream: {}
|
509
|
+
command_name: aggregate
|
510
|
+
database_name: *database_name
|
511
|
+
result:
|
512
|
+
success:
|
513
|
+
-
|
514
|
+
operationType: insert
|
515
|
+
ns:
|
516
|
+
db: *database_name
|
517
|
+
coll: *collection_name
|
518
|
+
fullDocument:
|
519
|
+
x:
|
520
|
+
$numberInt: "1"
|
521
|
+
-
|
522
|
+
operationType: insert
|
523
|
+
ns:
|
524
|
+
db: *database_name
|
525
|
+
coll: *collection_name
|
526
|
+
fullDocument:
|
527
|
+
x:
|
528
|
+
$numberInt: "2"
|
529
|
+
-
|
530
|
+
operationType: insert
|
531
|
+
ns:
|
532
|
+
db: *database_name
|
533
|
+
coll: *collection_name
|
534
|
+
fullDocument:
|
535
|
+
x:
|
536
|
+
$numberInt: "3"
|