From c14057bb2438defa427b513ed8d1689e2a747cee Mon Sep 17 00:00:00 2001 From: Dmitry Rybakov Date: Thu, 17 Oct 2024 15:59:25 +0200 Subject: [PATCH] Fix PoolCleared spec --- .evergreen/config.yml | 102 ++++++++++-------- .evergreen/config/axes.yml.erb | 8 ++ .evergreen/config/standard.yml.erb | 12 +-- .mod/drivers-evergreen-tools | 2 +- mongo.gemspec | 1 + .../custom_endpoint_spec.rb | 2 +- .../retryable_writes_errors_spec.rb | 6 +- spec/mongo/client_encryption_spec.rb | 2 +- 8 files changed, 76 insertions(+), 59 deletions(-) diff --git a/.evergreen/config.yml b/.evergreen/config.yml index 4b2a149f25..0dfd9fab60 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -1047,6 +1047,14 @@ axes: - id: "ruby" display_name: Ruby Version values: + - id: "ruby-3.4" + display_name: ruby-3.4 + variables: + RVM_RUBY: "ruby-3.4" + - id: "ruby-3.3" + display_name: ruby-3.3 + variables: + RVM_RUBY: "ruby-3.3" - id: "ruby-3.2" display_name: ruby-3.2 variables: @@ -1313,7 +1321,7 @@ axes: buildvariants: - matrix_name: DriverBench matrix_spec: - ruby: "ruby-3.2" + ruby: "ruby-3.3" mongodb-version: "7.0" topology: standalone os: ubuntu2204 @@ -1324,7 +1332,7 @@ buildvariants: - matrix_name: "auth/ssl" matrix_spec: auth-and-ssl: ["auth-and-ssl", "noauth-and-nossl"] - ruby: "ruby-3.2" + ruby: "ruby-3.3" mongodb-version: ["latest", "8.0", "7.0"] topology: ["standalone", "replica-set", "sharded-cluster"] os: ubuntu2204 @@ -1334,7 +1342,7 @@ buildvariants: - matrix_name: "mongo-recent" matrix_spec: - ruby: ["ruby-3.2", "ruby-3.1", "jruby-9.4"] + ruby: ["ruby-3.3", "ruby-3.2", "jruby-9.4"] mongodb-version: ["latest", "8.0", "7.0"] topology: ["standalone", "replica-set", "sharded-cluster"] os: ubuntu2204 @@ -1344,7 +1352,7 @@ buildvariants: - matrix_name: "mongo-8-arm" matrix_spec: - ruby: "ruby-3.2" + ruby: "ruby-3.3" mongodb-version: [ '8.0' ] topology: ["standalone", "replica-set", "sharded-cluster"] os: ubuntu2404-arm @@ -1354,7 +1362,7 @@ buildvariants: - matrix_name: "mongo-5.x" matrix_spec: - ruby: ["ruby-3.2", "ruby-3.1", "jruby-9.4"] + ruby: ["ruby-3.3", "ruby-3.2", "jruby-9.4"] mongodb-version: ['5.3'] topology: ["standalone", "replica-set", "sharded-cluster"] os: ubuntu1804 @@ -1384,7 +1392,7 @@ buildvariants: - matrix_name: "single-lb" matrix_spec: - ruby: "ruby-3.2" + ruby: "ruby-3.3" mongodb-version: "7.0" topology: load-balanced single-mongos: single-mongos @@ -1395,7 +1403,7 @@ buildvariants: - matrix_name: "mongo-api-version" matrix_spec: - ruby: "ruby-3.2" + ruby: "ruby-3.3" mongodb-version: '7.0' topology: standalone api-version-required: yes @@ -1406,7 +1414,7 @@ buildvariants: - matrix_name: "single-mongos" matrix_spec: - ruby: "ruby-3.2" + ruby: "ruby-3.3" mongodb-version: "7.0" topology: "sharded-cluster" single-mongos: single-mongos @@ -1417,7 +1425,7 @@ buildvariants: - matrix_name: CSOT matrix_spec: - ruby: "ruby-3.2" + ruby: "ruby-3.3" mongodb-version: "7.0" topology: replica-set-single-node os: ubuntu2204 @@ -1428,7 +1436,7 @@ buildvariants: - matrix_name: "no-retry-reads" matrix_spec: retry-reads: no-retry-reads - ruby: "ruby-3.2" + ruby: "ruby-3.3" mongodb-version: "7.0" topology: ["standalone", "replica-set", "sharded-cluster"] os: ubuntu2204 @@ -1439,7 +1447,7 @@ buildvariants: - matrix_name: "no-retry-writes" matrix_spec: retry-writes: no-retry-writes - ruby: "ruby-3.2" + ruby: "ruby-3.3" mongodb-version: "7.0" topology: [replica-set, sharded-cluster] os: ubuntu2204 @@ -1461,7 +1469,7 @@ buildvariants: - matrix_name: "lint" matrix_spec: lint: on - ruby: "ruby-3.2" + ruby: "ruby-3.3" mongodb-version: "7.0" topology: ["standalone", "replica-set", "sharded-cluster"] os: ubuntu2204 @@ -1472,7 +1480,7 @@ buildvariants: - matrix_name: "fork" matrix_spec: fork: on - ruby: "ruby-3.2" + ruby: "ruby-3.3" mongodb-version: "7.0" topology: ["standalone", "replica-set", "sharded-cluster"] os: ubuntu2204 @@ -1483,7 +1491,7 @@ buildvariants: - matrix_name: "solo" matrix_spec: solo: on - ruby: ["ruby-3.2", "ruby-3.1"] + ruby: ["ruby-3.3", "ruby-3.2", "ruby-3.1"] mongodb-version: "7.0" topology: ["standalone", "replica-set", "sharded-cluster"] os: ubuntu2204 @@ -1505,7 +1513,7 @@ buildvariants: - matrix_name: "stress" matrix_spec: stress: on - ruby: "ruby-3.2" + ruby: "ruby-3.3" mongodb-version: ["8.0", "7.0"] topology: replica-set os: ubuntu2204 @@ -1540,10 +1548,10 @@ buildvariants: tasks: - name: "test-mlaunch" - - matrix_name: zlib-"ruby-3.2" + - matrix_name: zlib-"ruby-3.3" matrix_spec: auth-and-ssl: [ "auth-and-ssl", "noauth-and-nossl" ] - ruby: "ruby-3.2" + ruby: "ruby-3.3" mongodb-version: "7.0" topology: "replica-set" compressor: 'zlib' @@ -1552,10 +1560,10 @@ buildvariants: tasks: - name: "test-mlaunch" - - matrix_name: snappy-"ruby-3.2" + - matrix_name: snappy-"ruby-3.3" matrix_spec: auth-and-ssl: [ "auth-and-ssl", "noauth-and-nossl" ] - ruby: "ruby-3.2" + ruby: "ruby-3.3" mongodb-version: "7.0" topology: "replica-set" compressor: 'snappy' @@ -1568,10 +1576,10 @@ buildvariants: # apparently a zstd-jni gem for JRuby that we could investigate here; if # this test is ever supported to support jruby, the `sample_mri_rubies` # reference should be replaced with `sample_rubies`. - - matrix_name: zstd-auth-"ruby-3.2" + - matrix_name: zstd-auth-"ruby-3.3" matrix_spec: auth-and-ssl: [ "auth-and-ssl", "noauth-and-nossl" ] - ruby: "ruby-3.2" + ruby: "ruby-3.3" mongodb-version: "7.0" topology: "replica-set" compressor: 'zstd' @@ -1580,9 +1588,9 @@ buildvariants: tasks: - name: "test-mlaunch" - - matrix_name: activesupport-"ruby-3.2" + - matrix_name: activesupport-"ruby-3.3" matrix_spec: - ruby: "ruby-3.2" + ruby: "ruby-3.3" mongodb-version: "7.0" topology: replica-set as: as @@ -1591,9 +1599,9 @@ buildvariants: tasks: - name: "test-mlaunch" - - matrix_name: bson-"ruby-3.2" + - matrix_name: bson-"ruby-3.3" matrix_spec: - ruby: "ruby-3.2" + ruby: "ruby-3.3" mongodb-version: "7.0" topology: replica-set bson: "*" @@ -1666,7 +1674,7 @@ buildvariants: - matrix_name: "fle above 4.4" matrix_spec: auth-and-ssl: "noauth-and-nossl" - ruby: ["ruby-3.2", "ruby-3.1"] + ruby: ["ruby-3.3", "ruby-3.2", "ruby-3.1"] topology: [replica-set, sharded-cluster] mongodb-version: [ '6.0', '7.0', '8.0' ] os: ubuntu2204 @@ -1677,7 +1685,7 @@ buildvariants: # kerberos integration tests are broken (RUBY-3266) # - matrix_name: "kerberos-integration" # matrix_spec: - # ruby: ["ruby-3.2", "ruby-2.7", "jruby-9.4"] + # ruby: ["ruby-3.3", "ruby-2.7", "jruby-9.4"] # os: rhel8 # display_name: "Kerberos integration ${os} ${ruby}" # tasks: @@ -1685,7 +1693,7 @@ buildvariants: - matrix_name: "kerberos-unit" matrix_spec: - ruby: "ruby-3.2" + ruby: "ruby-3.3" mongodb-version: "7.0" topology: standalone os: ubuntu2204 @@ -1697,7 +1705,7 @@ buildvariants: - matrix_name: "fle-latest" matrix_spec: auth-and-ssl: "noauth-and-nossl" - ruby: "ruby-3.2" + ruby: "ruby-3.3" topology: [replica-set, sharded-cluster] mongodb-version: [ 'latest' ] os: ubuntu2204 @@ -1711,7 +1719,7 @@ buildvariants: # https://jira.mongodb.org/browse/RUBY-3311 # auth-and-ssl: [ aws-regular, aws-assume-role, aws-ec2, aws-ecs, aws-web-identity ] auth-and-ssl: [ aws-regular, aws-assume-role, aws-ecs, aws-web-identity ] - ruby: "ruby-3.2" + ruby: "ruby-3.3" topology: standalone # needs the latest_5x_mdb because run-tests.sh uses `mongo` to configure # the server for certain auth mechanisms. Once run-tests.sh is made smart @@ -1728,7 +1736,7 @@ buildvariants: matrix_spec: ocsp-verifier: true # No JRuby due to https://github.com/jruby/jruby-openssl/issues/210 - ruby: ["ruby-3.2", "ruby-3.1"] + ruby: ["ruby-3.3", "ruby-3.2", "ruby-3.1"] topology: standalone mongodb-version: "7.0" os: ubuntu2204 @@ -1741,7 +1749,7 @@ buildvariants: ocsp-algorithm: ecdsa ocsp-must-staple: on ocsp-delegate: on - ruby: "ruby-3.2" + ruby: "ruby-3.3" topology: standalone mongodb-version: "7.0" os: ubuntu2204 @@ -1754,7 +1762,7 @@ buildvariants: matrix_spec: ocsp-algorithm: rsa ocsp-status: unknown - ruby: "ruby-3.2" + ruby: "ruby-3.3" topology: standalone mongodb-version: "7.0" os: ubuntu2204 @@ -1770,7 +1778,7 @@ buildvariants: ocsp-delegate: '*' ocsp-connectivity: pass extra-uri-options: "none" - ruby: "ruby-3.2" + ruby: "ruby-3.3" topology: standalone mongodb-version: "7.0" os: ubuntu2204 @@ -1784,7 +1792,7 @@ buildvariants: ocsp-delegate: '*' ocsp-connectivity: pass extra-uri-options: "none" - ruby: "ruby-3.2" + ruby: "ruby-3.3" topology: standalone mongodb-version: "7.0" os: ubuntu2204 @@ -1798,7 +1806,7 @@ buildvariants: ocsp-delegate: '*' ocsp-connectivity: fail extra-uri-options: "none" - ruby: "ruby-3.2" + ruby: "ruby-3.3" topology: standalone mongodb-version: "7.0" os: ubuntu2204 @@ -1812,7 +1820,7 @@ buildvariants: ocsp-delegate: '*' ocsp-connectivity: pass extra-uri-options: "tlsInsecure=true" - ruby: "ruby-3.2" + ruby: "ruby-3.3" topology: standalone mongodb-version: "7.0" os: ubuntu2204 @@ -1826,7 +1834,7 @@ buildvariants: ocsp-delegate: '*' ocsp-connectivity: pass extra-uri-options: "tlsInsecure=true" - ruby: "ruby-3.2" + ruby: "ruby-3.3" topology: standalone mongodb-version: "7.0" os: ubuntu2204 @@ -1840,7 +1848,7 @@ buildvariants: ocsp-delegate: '*' ocsp-connectivity: pass extra-uri-options: "tlsInsecure=true" - ruby: "ruby-3.2" + ruby: "ruby-3.3" topology: standalone mongodb-version: "7.0" os: ubuntu2204 @@ -1854,7 +1862,7 @@ buildvariants: ocsp-delegate: '*' ocsp-connectivity: pass extra-uri-options: "tlsAllowInvalidCertificates=true" - ruby: "ruby-3.2" + ruby: "ruby-3.3" topology: standalone mongodb-version: "7.0" os: ubuntu2204 @@ -1868,7 +1876,7 @@ buildvariants: ocsp-delegate: '*' ocsp-connectivity: pass extra-uri-options: "tlsAllowInvalidCertificates=true" - ruby: "ruby-3.2" + ruby: "ruby-3.3" topology: standalone mongodb-version: "7.0" os: ubuntu2204 @@ -1882,7 +1890,7 @@ buildvariants: ocsp-delegate: '*' ocsp-connectivity: pass extra-uri-options: "tlsAllowInvalidCertificates=true" - ruby: "ruby-3.2" + ruby: "ruby-3.3" topology: standalone mongodb-version: "7.0" os: ubuntu2204 @@ -1913,7 +1921,7 @@ buildvariants: # https://jira.mongodb.org/browse/RUBY-3540 #- matrix_name: testgcpkms-variant # matrix_spec: - # ruby: "ruby-3.2" + # ruby: "ruby-3.3" # fle: helper # topology: standalone # os: ubuntu2204 @@ -1937,7 +1945,7 @@ buildvariants: - matrix_name: atlas-full matrix_spec: - ruby: "ruby-3.2" + ruby: "ruby-3.3" os: ubuntu2204 display_name: "Atlas (Full)" tasks: @@ -1945,7 +1953,7 @@ buildvariants: - matrix_name: "atlas" matrix_spec: - ruby: ["ruby-3.2", "ruby-3.1"] + ruby: ["ruby-3.3", "ruby-3.2", "ruby-3.1"] os: ubuntu2204 display_name: "Atlas tests ${ruby}" tasks: @@ -1953,7 +1961,7 @@ buildvariants: - matrix_name: "serverless" matrix_spec: - ruby: "ruby-3.2" + ruby: "ruby-3.3" fle: path os: ubuntu2204 display_name: "Atlas serverless ${ruby}" @@ -1962,7 +1970,7 @@ buildvariants: - matrix_name: "aws-lambda" matrix_spec: - ruby: "ruby-3.2" + ruby: 'ruby-3.2' os: ubuntu2204 display_name: "AWS Lambda" tasks: diff --git a/.evergreen/config/axes.yml.erb b/.evergreen/config/axes.yml.erb index e28ab2773f..dbdcfbfdb6 100644 --- a/.evergreen/config/axes.yml.erb +++ b/.evergreen/config/axes.yml.erb @@ -150,6 +150,14 @@ axes: - id: "ruby" display_name: Ruby Version values: + - id: "ruby-3.4" + display_name: ruby-3.4 + variables: + RVM_RUBY: "ruby-3.4" + - id: "ruby-3.3" + display_name: ruby-3.3 + variables: + RVM_RUBY: "ruby-3.3" - id: "ruby-3.2" display_name: ruby-3.2 variables: diff --git a/.evergreen/config/standard.yml.erb b/.evergreen/config/standard.yml.erb index 7b91d4fac7..83cf0157db 100644 --- a/.evergreen/config/standard.yml.erb +++ b/.evergreen/config/standard.yml.erb @@ -3,13 +3,13 @@ # latest_ruby = the most recently released, stable version of Ruby # (make sure this version is being built by 10gen/mongo-ruby-toolchain) - latest_ruby = "ruby-3.2".inspect # so it gets quoted as a string + latest_ruby = "ruby-3.3".inspect # so it gets quoted as a string # these are used for testing against a few recent ruby versions - recent_rubies = %w( ruby-3.2 ruby-3.1 jruby-9.4 ) + recent_rubies = %w( ruby-3.3 ruby-3.2 jruby-9.4 ) # this is a list of the most most recent 3.x and 2.x MRI ruby versions - sample_mri_rubies = %w( ruby-3.2 ruby-2.7 ) + sample_mri_rubies = %w( ruby-3.3 ruby-2.7 ) # as above, but including the most recent JRuby release sample_rubies = sample_mri_rubies + %w( jruby-9.4 ) @@ -20,9 +20,9 @@ # all supported JRuby versions provided by 10gen/mongo-ruby-toolchain jrubies = %w( jruby-9.4 jruby-9.3 ) - supported_mri_rubies_3 = %w( ruby-3.2 ruby-3.1 ruby-3.0 ) + supported_mri_rubies_3 = %w( ruby-3.3 ruby-3.2 ruby-3.1 ruby-3.0 ) - supported_mri_rubies_3_ubuntu = %w( ruby-3.2 ruby-3.1 ) + supported_mri_rubies_3_ubuntu = %w( ruby-3.3 ruby-3.2 ruby-3.1 ) supported_mri_ruby_2 = "ruby-2.7".inspect @@ -542,7 +542,7 @@ buildvariants: - matrix_name: "aws-lambda" matrix_spec: - ruby: <%= latest_ruby %> + ruby: 'ruby-3.2' os: ubuntu2204 display_name: "AWS Lambda" tasks: diff --git a/.mod/drivers-evergreen-tools b/.mod/drivers-evergreen-tools index d835aa5c4a..9142b7055e 160000 --- a/.mod/drivers-evergreen-tools +++ b/.mod/drivers-evergreen-tools @@ -1 +1 @@ -Subproject commit d835aa5c4a9163938e42b7bc701ae8f33d0414c5 +Subproject commit 9142b7055ea5940e59ad41c4b069376f867031da diff --git a/mongo.gemspec b/mongo.gemspec index 7e3d4f64f8..a4bec6e854 100644 --- a/mongo.gemspec +++ b/mongo.gemspec @@ -38,5 +38,6 @@ Gem::Specification.new do |s| s.required_ruby_version = ">= 2.5" + s.add_dependency 'base64' s.add_dependency 'bson', '>=4.14.1', '<6.0.0' end diff --git a/spec/integration/client_side_encryption/custom_endpoint_spec.rb b/spec/integration/client_side_encryption/custom_endpoint_spec.rb index e810f3ece4..016a99c29a 100644 --- a/spec/integration/client_side_encryption/custom_endpoint_spec.rb +++ b/spec/integration/client_side_encryption/custom_endpoint_spec.rb @@ -123,7 +123,7 @@ end let(:error_regex) do - /SocketError: getaddrinfo:/ + /(SocketError|ResolutionError): getaddrinfo:/ end it_behaves_like 'raising a KMS error' diff --git a/spec/integration/retryable_writes_errors_spec.rb b/spec/integration/retryable_writes_errors_spec.rb index 25b5cba8aa..74619530dd 100644 --- a/spec/integration/retryable_writes_errors_spec.rb +++ b/spec/integration/retryable_writes_errors_spec.rb @@ -93,7 +93,7 @@ end context "PoolClearedError retryability test" do - require_topology :single, :replica_set, :sharded + require_topology :single, :sharded require_no_multi_mongos require_fail_command require_retry_writes @@ -162,8 +162,8 @@ # be rescanned and the pool to be unpaused, allowing the second checkout # to succeed (when it should fail). Therefore we want the second insert's # check out to win the race. This gives the check out a little head start. - allow_any_instance_of(Mongo::Server::ConnectionPool).to receive(:ready).and_wrap_original do |m, *args, &block| - ::Utils.wait_for_condition(5) do + allow(collection.cluster.next_primary.pool).to receive(:ready).and_wrap_original do |m, *args, &block| + ::Utils.wait_for_condition(3) do # check_out_results should contain: # - insert1 connection check out successful # - pool cleared diff --git a/spec/mongo/client_encryption_spec.rb b/spec/mongo/client_encryption_spec.rb index 84b3cd59a5..b5fa7a3a58 100644 --- a/spec/mongo/client_encryption_spec.rb +++ b/spec/mongo/client_encryption_spec.rb @@ -289,7 +289,7 @@ it 'raises an exception' do expect do data_key_id - end.to raise_error(Mongo::Error::KmsError, /SocketError/) + end.to raise_error(Mongo::Error::KmsError, /SocketError|ResolutionError/) end end