diff --git a/.evergreen/config.yml b/.evergreen/config.yml index 9e28ac3fdf..10fb23b8cf 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -14,7 +14,7 @@ pre_error_fails_task: true command_type: system # Protect ourself against rogue test case, or curl gone wild, that runs forever. -exec_timeout_secs: 3600 +exec_timeout_secs: 5400 # What to do when evergreen hits the timeout (`post:` tasks are run automatically) timeout: @@ -346,7 +346,7 @@ functions: "upload test results": - command: attach.xunit_results params: - file: ./src/tmp/rspec.xml + file: ./src/rspec.xml "delete private environment": - command: shell.exec @@ -482,7 +482,7 @@ post: # Removed, causing timeouts # - func: "upload working dir" - func: "upload mo artifacts" - #- func: "upload test results" + # - func: "upload test results" - func: "upload test results to s3" task_groups: @@ -927,11 +927,6 @@ axes: display_name: "6.0" variables: MONGODB_VERSION: "6.0" - - id: "5.3" - display_name: "5.3" - variables: - MONGODB_VERSION: "5.3" - CRYPT_SHARED_VERSION: "6.0.5" - id: "5.0" display_name: "5.0" variables: @@ -1047,6 +1042,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 +1316,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 +1327,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 +1337,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 +1347,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,8 +1357,8 @@ buildvariants: - matrix_name: "mongo-5.x" matrix_spec: - ruby: ["ruby-3.2", "ruby-3.1", "jruby-9.4"] - mongodb-version: ['5.3'] + ruby: ["ruby-3.3", "ruby-3.2", "jruby-9.4"] + mongodb-version: ['5.0'] topology: ["standalone", "replica-set", "sharded-cluster"] os: ubuntu1804 display_name: "${mongodb-version} ${topology} ${auth-and-ssl} ${ruby}" @@ -1384,7 +1387,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 +1398,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 +1409,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 +1420,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 +1431,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 +1442,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 +1464,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 +1475,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 +1486,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 +1508,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 @@ -1516,15 +1519,10 @@ buildvariants: - matrix_name: "x509-tests" matrix_spec: auth-and-ssl: "x509" - ruby: 'ruby-3.1' - # 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 - # enough to install mongosh, and then use either mongo or mongosh - # (depending on server version and what's available), we can bump this to - # the latest stable db version. - mongodb-version: "5.3" + ruby: "ruby-3.3" + mongodb-version: "7.0" topology: standalone - os: ubuntu1804 + os: ubuntu2204 display_name: "${mongodb-version} ${topology} ${auth-and-ssl} ${ruby}" tasks: - name: "test-mlaunch" @@ -1540,10 +1538,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 +1550,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 +1566,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 +1578,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 +1589,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 +1664,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 +1675,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 +1683,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 +1695,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,15 +1709,10 @@ 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 - # enough to install mongosh, and then use either mongo or mongosh - # (depending on server version and what's available), we can bump this to - # the latest stable db version. - mongodb-version: "5.3" - os: ubuntu1804 + mongodb-version: "7.0" + os: ubuntu2204 display_name: "AWS ${auth-and-ssl} ${mongodb-version} ${ruby}" tasks: - name: "test-aws-auth" @@ -1728,7 +1721,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 +1734,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 +1747,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 +1763,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 +1777,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 +1791,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 +1805,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 +1819,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 +1833,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 +1847,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 +1861,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 +1875,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 +1906,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 +1930,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 +1938,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 +1946,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 +1955,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..44e018f5de 100644 --- a/.evergreen/config/axes.yml.erb +++ b/.evergreen/config/axes.yml.erb @@ -30,11 +30,6 @@ axes: display_name: "6.0" variables: MONGODB_VERSION: "6.0" - - id: "5.3" - display_name: "5.3" - variables: - MONGODB_VERSION: "5.3" - CRYPT_SHARED_VERSION: "6.0.5" - id: "5.0" display_name: "5.0" variables: @@ -150,6 +145,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/common.yml.erb b/.evergreen/config/common.yml.erb index 2c4dcbb0a9..60f7707b8a 100644 --- a/.evergreen/config/common.yml.erb +++ b/.evergreen/config/common.yml.erb @@ -11,7 +11,7 @@ pre_error_fails_task: true command_type: system # Protect ourself against rogue test case, or curl gone wild, that runs forever. -exec_timeout_secs: 3600 +exec_timeout_secs: 5400 # What to do when evergreen hits the timeout (`post:` tasks are run automatically) timeout: @@ -343,7 +343,7 @@ functions: "upload test results": - command: attach.xunit_results params: - file: ./src/tmp/rspec.xml + file: ./src/rspec.xml "delete private environment": - command: shell.exec @@ -479,7 +479,7 @@ post: # Removed, causing timeouts # - func: "upload working dir" - func: "upload mo artifacts" - #- func: "upload test results" + # - func: "upload test results" - func: "upload test results to s3" task_groups: diff --git a/.evergreen/config/standard.yml.erb b/.evergreen/config/standard.yml.erb index 7b91d4fac7..4c4ea57630 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 @@ -37,9 +37,8 @@ actual_and_upcoming_mdb = %w( latest 8.0 7.0 ) recent_mdb = %w( 8.0 7.0 ) - latest_5x_mdb = "5.3".inspect # so it gets quoted as a string - all_dbs = %w(latest 8.0 7.0 6.0 5.3 5.0 4.4 4.2 4.0 3.6) + all_dbs = %w(latest 8.0 7.0 6.0 5.0 4.4 4.2 4.0 3.6) %> buildvariants: @@ -87,7 +86,7 @@ buildvariants: - matrix_name: "mongo-5.x" matrix_spec: ruby: <%= recent_rubies %> - mongodb-version: ['5.3'] + mongodb-version: ['5.0'] topology: <%= topologies %> os: ubuntu1804 display_name: "${mongodb-version} ${topology} ${auth-and-ssl} ${ruby}" @@ -248,15 +247,10 @@ buildvariants: - matrix_name: "x509-tests" matrix_spec: auth-and-ssl: "x509" - ruby: 'ruby-3.1' - # 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 - # enough to install mongosh, and then use either mongo or mongosh - # (depending on server version and what's available), we can bump this to - # the latest stable db version. - mongodb-version: <%= latest_5x_mdb %> + ruby: <%= latest_ruby %> + mongodb-version: <%= latest_stable_mdb %> topology: standalone - os: ubuntu1804 + os: ubuntu2204 display_name: "${mongodb-version} ${topology} ${auth-and-ssl} ${ruby}" tasks: - name: "test-mlaunch" @@ -390,13 +384,8 @@ buildvariants: auth-and-ssl: [ aws-regular, aws-assume-role, aws-ecs, aws-web-identity ] ruby: <%= latest_ruby %> 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 - # enough to install mongosh, and then use either mongo or mongosh - # (depending on server version and what's available), we can bump this to - # the latest stable db version. - mongodb-version: <%= latest_5x_mdb %> - os: ubuntu1804 + mongodb-version: <%= latest_stable_mdb %> + os: ubuntu2204 display_name: "AWS ${auth-and-ssl} ${mongodb-version} ${ruby}" tasks: - name: "test-aws-auth" @@ -542,7 +531,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/.evergreen/functions-kerberos.sh b/.evergreen/functions-kerberos.sh index 310e58218c..2ce893f175 100644 --- a/.evergreen/functions-kerberos.sh +++ b/.evergreen/functions-kerberos.sh @@ -76,8 +76,8 @@ configure_local_kerberos() { EOT `" - "$BINDIR"/mongo --eval "$create_user_cmd" - "$BINDIR"/mongo --eval 'db.getSiblingDB("kerberos").test.insert({kerberos: true, authenticated: "yeah"})' + "$BINDIR"/mongosh --eval "$create_user_cmd" + "$BINDIR"/mongosh --eval 'db.getSiblingDB("kerberos").test.insert({kerberos: true, authenticated: "yeah"})' pkill mongod sleep 1 diff --git a/.evergreen/run-tests-kerberos-integration.sh b/.evergreen/run-tests-kerberos-integration.sh index e7002d898e..b56e22ec1a 100755 --- a/.evergreen/run-tests-kerberos-integration.sh +++ b/.evergreen/run-tests-kerberos-integration.sh @@ -55,7 +55,7 @@ configure_kerberos_ip_addr # To test authentication using the mongo shell, note that the host name # must be uppercased when it is used in the username. # The following call works when using the docker image: -# /opt/mongodb/bin/mongo --host $SASL_HOST --authenticationMechanism=GSSAPI \ +# /opt/mongodb/bin/mongosh --host $SASL_HOST --authenticationMechanism=GSSAPI \ # --authenticationDatabase='$external' --username $SASL_USER@`echo $SASL_HOST |tr a-z A-Z` echo "Install dependencies" diff --git a/.evergreen/run-tests.sh b/.evergreen/run-tests.sh index 8a73e15c3b..653ca3b480 100755 --- a/.evergreen/run-tests.sh +++ b/.evergreen/run-tests.sh @@ -22,6 +22,10 @@ else set -x fi +if test -z "$PROJECT_DIRECTORY"; then + PROJECT_DIRECTORY=`realpath $(dirname $0)/..` +fi + MRSS_ROOT=`dirname "$0"`/../spec/shared . $MRSS_ROOT/shlib/distro.sh @@ -41,7 +45,7 @@ set_env_vars set_env_python set_env_ruby -prepare_server $arch +prepare_server if test "$DOCKER_PRELOAD" != 1; then install_mlaunch_venv @@ -118,7 +122,7 @@ elif test "$AUTH" = x509; then EOT `" - "$BINDIR"/mongo --tls \ + "$BINDIR"/mongosh --tls \ --tlsCAFile spec/support/certificates/ca.crt \ --tlsCertificateKeyFile spec/support/certificates/client-x509.pem \ -u bootstrap -p bootstrap \ @@ -286,7 +290,7 @@ fi export MONGODB_URI="mongodb://$hosts/?serverSelectionTimeoutMS=30000$uri_options" if echo "$AUTH" |grep -q ^aws-assume-role; then - $BINDIR/mongo "$MONGODB_URI" --eval 'db.runCommand({serverStatus: 1})' |wc + $BINDIR/mongosh "$MONGODB_URI" --eval 'db.runCommand({serverStatus: 1})' | wc fi set_fcv @@ -353,6 +357,7 @@ elif test "$SOLO" = 1; then fi done else + export JRUBY_OPTS=-J-Xmx2g bundle exec rake spec:ci fi @@ -364,18 +369,18 @@ if test -f tmp/rspec-all.json; then mv tmp/rspec-all.json tmp/rspec.json fi -kill_jruby +kill_jruby || true if test -n "$OCSP_MOCK_PID"; then kill "$OCSP_MOCK_PID" fi -python3 -m mtools.mlaunch.mlaunch stop --dir "$dbdir" +python3 -m mtools.mlaunch.mlaunch stop --dir "$dbdir" || true if test -n "$FLE" && test "$DOCKER_PRELOAD" != 1; then # Terminate all kmip servers... and whatever else happens to be running # that is a python script. - pkill python3 + pkill python3 || true fi exit ${test_status} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e3f468fe8b..7144427790 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,33 +16,33 @@ jobs: fail-fast: false matrix: os: [ ubuntu-20.04 ] - ruby: ["2.7", "3.0", "3.1", "3.2"] - mongodb: ["3.6", "4.4", "5.0", "6.0", "7.0"] + ruby: ["2.7", "3.0", "3.1", "3.2", "3.3"] + mongodb: ["4.4", "5.0", "6.0", "7.0", "8.0"] topology: [replica_set, sharded_cluster] include: - os: macos ruby: "2.7" - mongodb: "5.0" + mongodb: "7.0" topology: server - os: macos ruby: "3.0" - mongodb: "5.0" + mongodb: "7.0" topology: server - os: ubuntu-latest ruby: "2.7" - mongodb: "5.0" + mongodb: "7.0" topology: server - os: ubuntu-latest ruby: "3.1" - mongodb: "5.0" + mongodb: "7.0" topology: server - os: ubuntu-latest ruby: "3.2" - mongodb: "5.0" + mongodb: "7.0" topology: server - os: ubuntu-latest ruby: "3.2" - mongodb: "6.0" + mongodb: "8.0" topology: replica_set steps: - name: repo checkout diff --git a/.gitmodules b/.gitmodules index e1bab0957a..6d428f359d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -3,4 +3,4 @@ url = https://github.com/mongodb-labs/drivers-evergreen-tools [submodule "spec/shared"] path = spec/shared - url = git@github.com:mongodb-labs/mongo-ruby-spec-shared.git + url = git@github.com:mongodb-labs/mongo-ruby-spec-shared.git diff --git a/.mod/drivers-evergreen-tools b/.mod/drivers-evergreen-tools index 9728d31172..9142b7055e 160000 --- a/.mod/drivers-evergreen-tools +++ b/.mod/drivers-evergreen-tools @@ -1 +1 @@ -Subproject commit 9728d311722e098eed27456861e0701d16e3b019 +Subproject commit 9142b7055ea5940e59ad41c4b069376f867031da diff --git a/lib/mongo/error/pool_cleared_error.rb b/lib/mongo/error/pool_cleared_error.rb index 6f8b493e1a..d52b1ae198 100644 --- a/lib/mongo/error/pool_cleared_error.rb +++ b/lib/mongo/error/pool_cleared_error.rb @@ -31,6 +31,7 @@ class PoolClearedError < PoolError # # @api private def initialize(address, pool) + add_label('TransientTransactionError') super(address, pool, "Connection to #{address} interrupted due to server monitor timeout " + "(for pool 0x#{pool.object_id})") diff --git a/lib/mongo/search_index/view.rb b/lib/mongo/search_index/view.rb index 8c59771eab..39055f4774 100644 --- a/lib/mongo/search_index/view.rb +++ b/lib/mongo/search_index/view.rb @@ -48,8 +48,8 @@ def initialize(collection, options = {}) # @param [ nil | String ] name The name to give the new search index. # # @return [ String ] the name of the new search index. - def create_one(definition, name: nil) - create_many([ { name: name, definition: definition } ]).first + def create_one(definition, name: nil, type: 'search') + create_many([ { name: name, definition: definition, type: type } ]).first end # Create multiple search indexes with a single command. @@ -99,7 +99,7 @@ def each(&block) s[:name] = requested_index_name if requested_index_name end - collection.aggregate( + collection.with(read_concern: {}).aggregate( [ { '$listSearchIndexes' => spec } ], aggregate_options ) @@ -200,7 +200,7 @@ def validate_search_index!(doc) # # @raise [ ArgumentError ] if the list contains any invalid keys def validate_search_index_keys!(keys) - extras = keys - [ 'name', 'definition', :name, :definition ] + extras = keys - [ 'name', 'definition', 'type', :name, :definition, :type ] raise ArgumentError, "invalid keys in search index creation: #{extras.inspect}" if extras.any? end 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/README.aws-auth.md b/spec/README.aws-auth.md index 5f4bfef08d..82a757ca47 100644 --- a/spec/README.aws-auth.md +++ b/spec/README.aws-auth.md @@ -24,7 +24,7 @@ AWS authentication, and add a bootstrap user: Then connect as the bootstrap user and create AWS-mapped users: - mongo mongodb://root:toor@localhost:27017 + mongosh mongodb://root:toor@localhost:27017 # In the mongo shell: use $external @@ -41,7 +41,7 @@ With the server user created, it is possible to authenticate using AWS. The following example uses regular user credentials for an IAM user created as described in the next section; - mongo 'mongodb://AKIAAAAAAAAAAAA:t9t2mawssecretkey@localhost:27017/?authMechanism=MONGODB-AWS&authsource=$external' + mongosh 'mongodb://AKIAAAAAAAAAAAA:t9t2mawssecretkey@localhost:27017/?authMechanism=MONGODB-AWS&authsource=$external' To authenticate, provide the IAM user's access key id as the username and secret access key as the password. Note that the username and the password diff --git a/spec/README.md b/spec/README.md index cd100311c3..98d4b5a0d2 100644 --- a/spec/README.md +++ b/spec/README.md @@ -292,7 +292,7 @@ to a variable as follows: Use the MongoDB shell to execute this command: - mongo --tls \ + mongosh --tls \ --tlsCAFile `pwd`/spec/support/certificates/ca.crt \ --tlsCertificateKeyFile `pwd`/spec/support/certificates/client-x509.pem \ -u bootstrap -p bootstrap \ @@ -301,14 +301,14 @@ Use the MongoDB shell to execute this command: Verify that authentication is required by running the following command, which should fail: - mongo --tls \ + mongosh --tls \ --tlsCAFile `pwd`/spec/support/certificates/ca.crt \ --tlsCertificateKeyFile `pwd`/spec/support/certificates/client-x509.pem \ --eval 'db.serverStatus()' Verify that X.509 authentication works by running the following command: - mongo --tls \ + mongosh --tls \ --tlsCAFile `pwd`/spec/support/certificates/ca.crt \ --tlsCertificateKeyFile `pwd`/spec/support/certificates/client-x509.pem \ --authenticationDatabase '$external' \ 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 diff --git a/spec/mongo/error/pool_cleared_error_spec.rb b/spec/mongo/error/pool_cleared_error_spec.rb new file mode 100644 index 0000000000..38a3d6a9e3 --- /dev/null +++ b/spec/mongo/error/pool_cleared_error_spec.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +require 'lite_spec_helper' + +describe Mongo::Error::PoolClearedError do + describe '#initialize' do + let(:error) do + described_class.new( + instance_double(Mongo::Address), instance_double(Mongo::Server::ConnectionPool) + ) + end + + it 'appends TransientTransactionError' do + expect(error.labels).to include('TransientTransactionError') + end + end +end diff --git a/spec/runners/unified/search_index_operations.rb b/spec/runners/unified/search_index_operations.rb index d74ab57776..8e778cfbf5 100644 --- a/spec/runners/unified/search_index_operations.rb +++ b/spec/runners/unified/search_index_operations.rb @@ -11,7 +11,8 @@ def create_search_index(op) model = args.use('model') name = model.use('name') definition = model.use('definition') - collection.search_indexes.create_one(definition, name: name) + type = model.use('type') + collection.search_indexes.create_one(definition, name: name, type: type) end end diff --git a/spec/shared b/spec/shared index 2fe5724b0a..d73378a4cc 160000 --- a/spec/shared +++ b/spec/shared @@ -1 +1 @@ -Subproject commit 2fe5724b0a586fbeac602f15f7d43ccc7bbe531b +Subproject commit d73378a4cc9d07cda8375e1300c15add2c6b9a6c diff --git a/spec/spec_tests/data/client_side_operations_timeout/command-execution.yml b/spec/spec_tests/data/client_side_operations_timeout/command-execution.yml index 400a90867a..6ba0585b3c 100644 --- a/spec/spec_tests/data/client_side_operations_timeout/command-execution.yml +++ b/spec/spec_tests/data/client_side_operations_timeout/command-execution.yml @@ -3,9 +3,8 @@ description: "timeoutMS behaves correctly during command execution" schemaVersion: "1.9" runOnRequirements: - # The appName filter cannot be used to set a fail point on connection handshakes until server version 4.9 due to - # SERVER-49220/SERVER-49336. - - minServerVersion: "4.9" + # Require SERVER-49336 for failCommand + appName on the initial handshake. + - minServerVersion: "4.4.7" # Skip load-balanced and serverless which do not support RTT measurements. topologies: [ single, replicaset, sharded ] serverless: forbid diff --git a/spec/spec_tests/data/index_management/createSearchIndex.yml b/spec/spec_tests/data/index_management/createSearchIndex.yml index 2e3cf50f8d..8d05ee5042 100644 --- a/spec/spec_tests/data/index_management/createSearchIndex.yml +++ b/spec/spec_tests/data/index_management/createSearchIndex.yml @@ -16,7 +16,13 @@ createEntities: collectionName: *collection0 runOnRequirements: - - minServerVersion: "7.0.0" + # Skip server versions without fix of SERVER-83107 to avoid error message "BSON field 'createSearchIndexes.indexes.type' is an unknown field." + # SERVER-83107 was not backported to 7.1. + - minServerVersion: "7.0.5" + maxServerVersion: "7.0.99" + topologies: [ replicaset, load-balanced, sharded ] + serverless: forbid + - minServerVersion: "7.2.0" topologies: [ replicaset, load-balanced, sharded ] serverless: forbid @@ -26,7 +32,7 @@ tests: - name: createSearchIndex object: *collection0 arguments: - model: { definition: &definition { mappings: { dynamic: true } } } + model: { definition: &definition { mappings: { dynamic: true } } , type: 'search' } expectError: # This test always errors in a non-Atlas environment. The test functions as a unit test by asserting # that the driver constructs and sends the correct command. @@ -39,7 +45,7 @@ tests: - commandStartedEvent: command: createSearchIndexes: *collection0 - indexes: [ { definition: *definition } ] + indexes: [ { definition: *definition, type: 'search'} ] $db: *database0 - description: "name provided for an index definition" @@ -47,7 +53,29 @@ tests: - name: createSearchIndex object: *collection0 arguments: - model: { definition: &definition { mappings: { dynamic: true } } , name: 'test index' } + model: { definition: &definition { mappings: { dynamic: true } } , name: 'test index', type: 'search' } + expectError: + # This test always errors in a non-Atlas environment. The test functions as a unit test by asserting + # that the driver constructs and sends the correct command. + # The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages. + isError: true + errorContains: Atlas + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + createSearchIndexes: *collection0 + indexes: [ { definition: *definition, name: 'test index', type: 'search' } ] + $db: *database0 + + - description: "create a vector search index" + operations: + - name: createSearchIndex + object: *collection0 + arguments: + model: { definition: &definition { fields: [ {"type": "vector", "path": "plot_embedding", "numDimensions": 1536, "similarity": "euclidean"} ] } + , name: 'test index', type: 'vectorSearch' } expectError: # This test always errors in a non-Atlas environment. The test functions as a unit test by asserting # that the driver constructs and sends the correct command. @@ -60,5 +88,5 @@ tests: - commandStartedEvent: command: createSearchIndexes: *collection0 - indexes: [ { definition: *definition, name: 'test index' } ] + indexes: [ { definition: *definition, name: 'test index', type: 'vectorSearch' } ] $db: *database0 diff --git a/spec/spec_tests/data/index_management/createSearchIndexes.yml b/spec/spec_tests/data/index_management/createSearchIndexes.yml index db8f02e551..56ee5ff208 100644 --- a/spec/spec_tests/data/index_management/createSearchIndexes.yml +++ b/spec/spec_tests/data/index_management/createSearchIndexes.yml @@ -16,7 +16,13 @@ createEntities: collectionName: *collection0 runOnRequirements: - - minServerVersion: "7.0.0" + # Skip server versions without fix of SERVER-83107 to avoid error message "BSON field 'createSearchIndexes.indexes.type' is an unknown field." + # SERVER-83107 was not backported to 7.1. + - minServerVersion: "7.0.5" + maxServerVersion: "7.0.99" + topologies: [ replicaset, load-balanced, sharded ] + serverless: forbid + - minServerVersion: "7.2.0" topologies: [ replicaset, load-balanced, sharded ] serverless: forbid @@ -48,7 +54,7 @@ tests: - name: createSearchIndexes object: *collection0 arguments: - models: [ { definition: &definition { mappings: { dynamic: true } } } ] + models: [ { definition: &definition { mappings: { dynamic: true } } , type: 'search' } ] expectError: # This test always errors in a non-Atlas environment. The test functions as a unit test by asserting # that the driver constructs and sends the correct command. @@ -61,7 +67,7 @@ tests: - commandStartedEvent: command: createSearchIndexes: *collection0 - indexes: [ { definition: *definition } ] + indexes: [ { definition: *definition, type: 'search'} ] $db: *database0 - description: "name provided for an index definition" @@ -69,7 +75,29 @@ tests: - name: createSearchIndexes object: *collection0 arguments: - models: [ { definition: &definition { mappings: { dynamic: true } } , name: 'test index' } ] + models: [ { definition: &definition { mappings: { dynamic: true } } , name: 'test index' , type: 'search' } ] + expectError: + # This test always errors in a non-Atlas environment. The test functions as a unit test by asserting + # that the driver constructs and sends the correct command. + # The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages. + isError: true + errorContains: Atlas + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + createSearchIndexes: *collection0 + indexes: [ { definition: *definition, name: 'test index', type: 'search' } ] + $db: *database0 + + - description: "create a vector search index" + operations: + - name: createSearchIndexes + object: *collection0 + arguments: + models: [ { definition: &definition { fields: [ {"type": "vector", "path": "plot_embedding", "numDimensions": 1536, "similarity": "euclidean"} ] }, + name: 'test index' , type: 'vectorSearch' } ] expectError: # This test always errors in a non-Atlas environment. The test functions as a unit test by asserting # that the driver constructs and sends the correct command. @@ -82,5 +110,5 @@ tests: - commandStartedEvent: command: createSearchIndexes: *collection0 - indexes: [ { definition: *definition, name: 'test index' } ] + indexes: [ { definition: *definition, name: 'test index', type: 'vectorSearch' } ] $db: *database0 diff --git a/spec/spec_tests/data/index_management/listSearchIndexes.yml b/spec/spec_tests/data/index_management/listSearchIndexes.yml index c0d2d9ddc5..225a0c979c 100644 --- a/spec/spec_tests/data/index_management/listSearchIndexes.yml +++ b/spec/spec_tests/data/index_management/listSearchIndexes.yml @@ -15,6 +15,12 @@ createEntities: database: *database0 collectionName: *collection0 +initialData: + - collectionName: *collection0 + databaseName: *database0 + documents: + - x: 1 + runOnRequirements: - minServerVersion: "7.0.0" topologies: [ replicaset, load-balanced, sharded ] @@ -22,7 +28,6 @@ runOnRequirements: tests: - description: "when no name is provided, it does not populate the filter" - skipReason: https://jira.mongodb.org/browse/DRIVERS-2794 operations: - name: listSearchIndexes object: *collection0 @@ -42,11 +47,10 @@ tests: - $listSearchIndexes: {} - description: "when a name is provided, it is present in the filter" - skipReason: https://jira.mongodb.org/browse/DRIVERS-2794 operations: - name: listSearchIndexes object: *collection0 - arguments: + arguments: name: &indexName "test index" expectError: # This test always errors in a non-Atlas environment. The test functions as a unit test by asserting @@ -65,13 +69,12 @@ tests: $db: *database0 - description: aggregation cursor options are supported - skipReason: https://jira.mongodb.org/browse/DRIVERS-2794 operations: - name: listSearchIndexes object: *collection0 - arguments: + arguments: name: &indexName "test index" - aggregationOptions: + aggregationOptions: batchSize: 10 expectError: # This test always errors in a non-Atlas environment. The test functions as a unit test by asserting diff --git a/spec/spec_tests/data/index_management/searchIndexIgnoresReadWriteConcern.yml b/spec/spec_tests/data/index_management/searchIndexIgnoresReadWriteConcern.yml new file mode 100644 index 0000000000..c4056381e9 --- /dev/null +++ b/spec/spec_tests/data/index_management/searchIndexIgnoresReadWriteConcern.yml @@ -0,0 +1,148 @@ +description: "search index operations ignore read and write concern" +schemaVersion: "1.4" +createEntities: + - client: + id: &client0 client0 + useMultipleMongoses: false + # Set a non-default read and write concern. + uriOptions: + readConcernLevel: local + w: 1 + observeEvents: + - commandStartedEvent + - database: + id: &database0 database0 + client: *client0 + databaseName: *database0 + - collection: + id: &collection0 collection0 + database: *database0 + collectionName: *collection0 + +runOnRequirements: + - minServerVersion: "7.0.0" + topologies: [ replicaset, load-balanced, sharded ] + serverless: forbid + +tests: + - description: "createSearchIndex ignores read and write concern" + operations: + - name: createSearchIndex + object: *collection0 + arguments: + model: { definition: &definition { mappings: { dynamic: true } } } + expectError: + # This test always errors in a non-Atlas environment. The test functions as a unit test by asserting + # that the driver constructs and sends the correct command. + # The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages. + isError: true + errorContains: Atlas + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + createSearchIndexes: *collection0 + indexes: [ { definition: *definition } ] + $db: *database0 + # Expect no writeConcern or readConcern to be sent. + writeConcern: { $$exists: false } + readConcern: { $$exists: false } + + - description: "createSearchIndexes ignores read and write concern" + operations: + - name: createSearchIndexes + object: *collection0 + arguments: + models: [] + expectError: + # This test always errors in a non-Atlas environment. The test functions as a unit test by asserting + # that the driver constructs and sends the correct command. + # The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages. + isError: true + errorContains: Atlas + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + createSearchIndexes: *collection0 + indexes: [] + $db: *database0 + # Expect no writeConcern or readConcern to be sent. + writeConcern: { $$exists: false } + readConcern: { $$exists: false } + + - description: "dropSearchIndex ignores read and write concern" + operations: + - name: dropSearchIndex + object: *collection0 + arguments: + name: &indexName 'test index' + expectError: + # This test always errors in a non-Atlas environment. The test functions as a unit test by asserting + # that the driver constructs and sends the correct command. + # The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages. + isError: true + errorContains: Atlas + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + dropSearchIndex: *collection0 + name: *indexName + $db: *database0 + # Expect no writeConcern or readConcern to be sent. + writeConcern: { $$exists: false } + readConcern: { $$exists: false } + + # https://jira.mongodb.org/browse/RUBY-3351 + #- description: "listSearchIndexes ignores read and write concern" + # operations: + # - name: listSearchIndexes + # object: *collection0 + # expectError: + # # This test always errors in a non-Atlas environment. The test functions as a unit test by asserting + # # that the driver constructs and sends the correct command. + # # The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages. + # isError: true + # errorContains: Atlas + # expectEvents: + # - client: *client0 + # events: + # - commandStartedEvent: + # command: + # aggregate: *collection0 + # pipeline: + # - $listSearchIndexes: {} + # # Expect no writeConcern or readConcern to be sent. + # writeConcern: { $$exists: false } + # readConcern: { $$exists: false } + + - description: "updateSearchIndex ignores the read and write concern" + operations: + - name: updateSearchIndex + object: *collection0 + arguments: + name: &indexName 'test index' + definition: &definition {} + expectError: + # This test always errors in a non-Atlas environment. The test functions as a unit test by asserting + # that the driver constructs and sends the correct command. + # The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages. + isError: true + errorContains: Atlas + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + updateSearchIndex: *collection0 + name: *indexName + definition: *definition + $db: *database0 + # Expect no writeConcern or readConcern to be sent. + writeConcern: { $$exists: false } + readConcern: { $$exists: false } + diff --git a/spec/spec_tests/data/sdam_unified/hello-command-error.yml b/spec/spec_tests/data/sdam_unified/hello-command-error.yml index 2dc8be2f3b..1c9c079220 100644 --- a/spec/spec_tests/data/sdam_unified/hello-command-error.yml +++ b/spec/spec_tests/data/sdam_unified/hello-command-error.yml @@ -1,11 +1,11 @@ --- description: hello-command-error -schemaVersion: "1.10" +schemaVersion: "1.4" runOnRequirements: - # failCommand appName requirements - - minServerVersion: "4.9" + # Require SERVER-49336 for failCommand + appName on the initial handshake. + - minServerVersion: "4.4.7" serverless: forbid topologies: [ single, replicaset, sharded ] diff --git a/spec/spec_tests/data/sdam_unified/hello-network-error.yml b/spec/spec_tests/data/sdam_unified/hello-network-error.yml index fc3cdc4180..cdb10909ff 100644 --- a/spec/spec_tests/data/sdam_unified/hello-network-error.yml +++ b/spec/spec_tests/data/sdam_unified/hello-network-error.yml @@ -1,11 +1,11 @@ --- description: hello-network-error -schemaVersion: "1.10" +schemaVersion: "1.4" runOnRequirements: - # failCommand appName requirements - - minServerVersion: "4.9" + # Require SERVER-49336 for failCommand + appName on the initial handshake. + - minServerVersion: "4.4.7" serverless: forbid topologies: [ single, replicaset, sharded ] @@ -140,7 +140,6 @@ tests: # network error. Use "times: 4" to increase the probability that the # Monitor check fails since the RTT hello may trigger this failpoint one # or many times as well. - # The ruby driver only needs to fail twice because the RTT updates topology. - name: failPoint object: testRunner arguments: diff --git a/spec/spec_tests/data/sdam_unified/interruptInUse-pool-clear.yml b/spec/spec_tests/data/sdam_unified/interruptInUse-pool-clear.yml index 580ed23b7f..9293a986d5 100644 --- a/spec/spec_tests/data/sdam_unified/interruptInUse-pool-clear.yml +++ b/spec/spec_tests/data/sdam_unified/interruptInUse-pool-clear.yml @@ -5,7 +5,7 @@ schemaVersion: "1.11" runOnRequirements: # failCommand appName requirements - - minServerVersion: "4.9" + - minServerVersion: "4.4" serverless: forbid topologies: [ replicaset, sharded ] @@ -338,3 +338,4 @@ tests: databaseName: *databaseName documents: - { _id: 1, a : bar } + diff --git a/spec/spec_tests/data/sdam_unified/minPoolSize-error.yml b/spec/spec_tests/data/sdam_unified/minPoolSize-error.yml index cc72af578b..110e647c62 100644 --- a/spec/spec_tests/data/sdam_unified/minPoolSize-error.yml +++ b/spec/spec_tests/data/sdam_unified/minPoolSize-error.yml @@ -1,11 +1,11 @@ --- description: minPoolSize-error -schemaVersion: "1.10" +schemaVersion: "1.4" runOnRequirements: - # failCommand appName requirements - - minServerVersion: "4.9" + # Require SERVER-49336 for failCommand + appName on the initial handshake. + - minServerVersion: "4.4.7" serverless: forbid topologies: - single diff --git a/spec/support/certificates/README.md b/spec/support/certificates/README.md index c6251ea80b..d447a19c66 100644 --- a/spec/support/certificates/README.md +++ b/spec/support/certificates/README.md @@ -81,9 +81,9 @@ To sum up, openssl's command line tools appear to only handle certificate chains provided by the client when the server is verifying them, not the other way around and not when trying to standalone verify the chain. -## Manual Testing - mongo +## Manual Testing - mongosh -When it comes to `mongod` and `mongo`, certificate chains are supported in +When it comes to `mongod` and `mongosh`, certificate chains are supported in both directions: mongod --sslMode requireSSL \ @@ -91,16 +91,16 @@ both directions: --sslPEMKeyFile server-second-level-bundle.pem \ --sslClientCertificate client.pem - mongo --host localhost --ssl \ + mongosh --host localhost --ssl \ --sslCAFile ca.crt \ --sslPEMKeyFile client-second-level-bundle.pem -The `--host` option needs to be given to `mongo` because the certificates here +The `--host` option needs to be given to `mongosh` because the certificates here do not include 127.0.0.1 in subject alternate name. If the intermediate certificate is not provided, the connection should fail. # Expected to fail - mongo --host localhost --ssl \ + mongosh --host localhost --ssl \ --sslCAFile ca.crt \ --sslPEMKeyFile client-second-level.pem