diff --git a/.evergreen/config.yml b/.evergreen/config.yml index 9083da145b..e357f02f2b 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -2112,47 +2112,6 @@ axes: AUTH: "noauth" SSL: "nossl" - # Choice of MongoDB server version - - id: mongodb-version - display_name: "MongoDB" - values: - - id: "4.0" - display_name: "MongoDB 4.0" - variables: - VERSION: "4.0" - - id: "4.2" - display_name: "MongoDB 4.2" - variables: - VERSION: "4.2" - - id: "4.4" - display_name: "MongoDB 4.4" - variables: - VERSION: "4.4" - - id: "5.0" - display_name: "MongoDB 5.0" - variables: - VERSION: "5.0" - - id: "6.0" - display_name: "MongoDB 6.0" - variables: - VERSION: "6.0" - - id: "7.0" - display_name: "MongoDB 7.0" - variables: - VERSION: "7.0" - - id: "8.0" - display_name: "MongoDB 8.0" - variables: - VERSION: "8.0" - - id: "latest" - display_name: "MongoDB latest" - variables: - VERSION: "latest" - - id: "rapid" - display_name: "MongoDB rapid" - variables: - VERSION: "rapid" - # Choice of Python runtime version - id: python-version display_name: "Python" @@ -2212,132 +2171,8 @@ axes: variables: PYTHON_BINARY: "C:/python/Python313/python.exe" - - id: python-version-windows-32 - display_name: "Python" - values: - - - - id: "3.9" - display_name: "32-bit Python 3.9" - variables: - PYTHON_BINARY: "C:/python/32/Python39/python.exe" - - id: "3.10" - display_name: "32-bit Python 3.10" - variables: - PYTHON_BINARY: "C:/python/32/Python310/python.exe" - - id: "3.11" - display_name: "32-bit Python 3.11" - variables: - PYTHON_BINARY: "C:/python/32/Python311/python.exe" - - id: "3.12" - display_name: "32-bit Python 3.12" - variables: - PYTHON_BINARY: "C:/python/32/Python312/python.exe" - - id: "3.13" - display_name: "32-bit Python 3.13" - variables: - PYTHON_BINARY: "C:/python/32/Python313/python.exe" - - # Choice of mod_wsgi version - - id: mod-wsgi-version - display_name: "mod_wsgi version" - values: - - id: "4" - display_name: "mod_wsgi 4.x" - variables: - MOD_WSGI_VERSION: "4" - - # Choice of Python async framework - - id: green-framework - display_name: "Green Framework" - values: - - id: "eventlet" - display_name: "Eventlet" - variables: - GREEN_FRAMEWORK: "eventlet" - - id: "gevent" - display_name: "Gevent" - variables: - GREEN_FRAMEWORK: "gevent" - - # Install and use the driver's C-extensions? - - id: c-extensions - display_name: "C Extensions" - values: - - id: "without-c-extensions" - display_name: "Without C Extensions" - variables: - NO_EXT: "1" - - id: "with-c-extensions" - display_name: "With C Extensions" - variables: - NO_EXT: "" - - # Choice of MongoDB storage engine - - id: storage-engine - display_name: Storage - values: - - id: mmapv1 - display_name: MMAPv1 - variables: - STORAGE_ENGINE: "mmapv1" - - id: inmemory - display_name: InMemory - variables: - STORAGE_ENGINE: "inmemory" - - # Run with test commands disabled on server? - - id: disableTestCommands - display_name: Disable test commands - values: - - id: disabled - display_name: disabled - variables: - DISABLE_TEST_COMMANDS: "1" - - # Generate coverage report? - - id: coverage - display_name: "Coverage" - values: - - id: "coverage" - display_name: "Coverage" - tags: ["coverage_tag"] - variables: - COVERAGE: "coverage" - - - id: versionedApi - display_name: "versionedApi" - values: - # Test against a cluster with requireApiVersion=1. - - id: "requireApiVersion1" - display_name: "requireApiVersion1" - tags: [ "versionedApi_tag" ] - variables: - # REQUIRE_API_VERSION is set to make drivers-evergreen-tools - # start a cluster with the requireApiVersion parameter. - REQUIRE_API_VERSION: "1" - # MONGODB_API_VERSION is the apiVersion to use in the test suite. - MONGODB_API_VERSION: "1" - # Test against a cluster with acceptApiVersion2 but without - # requireApiVersion, and don't automatically add apiVersion to - # clients created in the test suite. - - id: "acceptApiVersion2" - display_name: "acceptApiVersion2" - tags: [ "versionedApi_tag" ] - variables: - ORCHESTRATION_FILE: "versioned-api-testing.json" - - - id: serverless - display_name: "Serverless" - values: - - id: "enabled" - display_name: "Serverless" - variables: - test_serverless: true - batchtime: 10080 # 7 days - buildvariants: -# Server Tests for RHEL8. +# Server Tests. - name: test-rhel8-py3.9-auth-ssl-cov tasks: - name: .standalone @@ -2504,8 +2339,6 @@ buildvariants: AUTH: auth SSL: ssl PYTHON_BINARY: /opt/python/pypy3.9/bin/python3 - -# Server tests for MacOS. - name: test-macos-py3.9-auth-ssl-sync tasks: - name: .standalone @@ -2516,8 +2349,32 @@ buildvariants: AUTH: auth SSL: ssl TEST_SUITES: default + SKIP_CSOT_TESTS: "true" + PYTHON_BINARY: /Library/Frameworks/Python.Framework/Versions/3.9/bin/python3 +- name: test-macos-py3.9-noauth-ssl-sync + tasks: + - name: .standalone + display_name: Test macOS py3.9 NoAuth SSL Sync + run_on: + - macos-14 + expansions: + AUTH: noauth + SSL: ssl + TEST_SUITES: default + SKIP_CSOT_TESTS: "true" PYTHON_BINARY: /Library/Frameworks/Python.Framework/Versions/3.9/bin/python3 +- name: test-macos-py3.9-noauth-nossl-sync + tasks: + - name: .standalone + display_name: Test macOS py3.9 NoAuth NoSSL Sync + run_on: + - macos-14 + expansions: + AUTH: noauth + SSL: nossl + TEST_SUITES: default SKIP_CSOT_TESTS: "true" + PYTHON_BINARY: /Library/Frameworks/Python.Framework/Versions/3.9/bin/python3 - name: test-macos-py3.9-auth-ssl-async tasks: - name: .standalone @@ -2528,11 +2385,47 @@ buildvariants: AUTH: auth SSL: ssl TEST_SUITES: default_async + SKIP_CSOT_TESTS: "true" + PYTHON_BINARY: /Library/Frameworks/Python.Framework/Versions/3.9/bin/python3 +- name: test-macos-py3.9-noauth-ssl-async + tasks: + - name: .standalone + display_name: Test macOS py3.9 NoAuth SSL Async + run_on: + - macos-14 + expansions: + AUTH: noauth + SSL: ssl + TEST_SUITES: default_async + SKIP_CSOT_TESTS: "true" + PYTHON_BINARY: /Library/Frameworks/Python.Framework/Versions/3.9/bin/python3 +- name: test-macos-py3.9-noauth-nossl-async + tasks: + - name: .standalone + display_name: Test macOS py3.9 NoAuth NoSSL Async + run_on: + - macos-14 + expansions: + AUTH: noauth + SSL: nossl + TEST_SUITES: default_async + SKIP_CSOT_TESTS: "true" PYTHON_BINARY: /Library/Frameworks/Python.Framework/Versions/3.9/bin/python3 +- name: test-macos-py3.13-auth-ssl-sync + tasks: + - name: .sharded_cluster + display_name: Test macOS py3.13 Auth SSL Sync + run_on: + - macos-14 + expansions: + AUTH: auth + SSL: ssl + TEST_SUITES: default SKIP_CSOT_TESTS: "true" + PYTHON_BINARY: /Library/Frameworks/Python.Framework/Versions/3.13/bin/python3 - name: test-macos-py3.13-noauth-ssl-sync tasks: - - name: .replica_set + - name: .sharded_cluster display_name: Test macOS py3.13 NoAuth SSL Sync run_on: - macos-14 @@ -2540,46 +2433,56 @@ buildvariants: AUTH: noauth SSL: ssl TEST_SUITES: default - PYTHON_BINARY: /Library/Frameworks/Python.Framework/Versions/3.13/bin/python3 SKIP_CSOT_TESTS: "true" -- name: test-macos-py3.13-noauth-ssl-async + PYTHON_BINARY: /Library/Frameworks/Python.Framework/Versions/3.13/bin/python3 +- name: test-macos-py3.13-noauth-nossl-sync tasks: - - name: .replica_set - display_name: Test macOS py3.13 NoAuth SSL Async + - name: .sharded_cluster + display_name: Test macOS py3.13 NoAuth NoSSL Sync run_on: - macos-14 expansions: AUTH: noauth + SSL: nossl + TEST_SUITES: default + SKIP_CSOT_TESTS: "true" + PYTHON_BINARY: /Library/Frameworks/Python.Framework/Versions/3.13/bin/python3 +- name: test-macos-py3.13-auth-ssl-async + tasks: + - name: .sharded_cluster + display_name: Test macOS py3.13 Auth SSL Async + run_on: + - macos-14 + expansions: + AUTH: auth SSL: ssl TEST_SUITES: default_async - PYTHON_BINARY: /Library/Frameworks/Python.Framework/Versions/3.13/bin/python3 SKIP_CSOT_TESTS: "true" -- name: test-macos-py3.9-noauth-nossl-sync + PYTHON_BINARY: /Library/Frameworks/Python.Framework/Versions/3.13/bin/python3 +- name: test-macos-py3.13-noauth-ssl-async tasks: - name: .sharded_cluster - display_name: Test macOS py3.9 NoAuth NoSSL Sync + display_name: Test macOS py3.13 NoAuth SSL Async run_on: - macos-14 expansions: AUTH: noauth - SSL: nossl - TEST_SUITES: default - PYTHON_BINARY: /Library/Frameworks/Python.Framework/Versions/3.9/bin/python3 + SSL: ssl + TEST_SUITES: default_async SKIP_CSOT_TESTS: "true" -- name: test-macos-py3.9-noauth-nossl-async + PYTHON_BINARY: /Library/Frameworks/Python.Framework/Versions/3.13/bin/python3 +- name: test-macos-py3.13-noauth-nossl-async tasks: - name: .sharded_cluster - display_name: Test macOS py3.9 NoAuth NoSSL Async + display_name: Test macOS py3.13 NoAuth NoSSL Async run_on: - macos-14 expansions: AUTH: noauth SSL: nossl TEST_SUITES: default_async - PYTHON_BINARY: /Library/Frameworks/Python.Framework/Versions/3.9/bin/python3 SKIP_CSOT_TESTS: "true" - -# Server tests for macOS Arm64. + PYTHON_BINARY: /Library/Frameworks/Python.Framework/Versions/3.13/bin/python3 - name: test-macos-arm64-py3.9-auth-ssl-sync tasks: - name: .standalone .6.0 @@ -2596,6 +2499,38 @@ buildvariants: TEST_SUITES: default SKIP_CSOT_TESTS: "true" PYTHON_BINARY: /Library/Frameworks/Python.Framework/Versions/3.9/bin/python3 +- name: test-macos-arm64-py3.9-noauth-ssl-sync + tasks: + - name: .standalone .6.0 + - name: .standalone .7.0 + - name: .standalone .8.0 + - name: .standalone .rapid + - name: .standalone .latest + display_name: Test macOS Arm64 py3.9 NoAuth SSL Sync + run_on: + - macos-14-arm64 + expansions: + AUTH: noauth + SSL: ssl + TEST_SUITES: default + SKIP_CSOT_TESTS: "true" + PYTHON_BINARY: /Library/Frameworks/Python.Framework/Versions/3.9/bin/python3 +- name: test-macos-arm64-py3.9-noauth-nossl-sync + tasks: + - name: .standalone .6.0 + - name: .standalone .7.0 + - name: .standalone .8.0 + - name: .standalone .rapid + - name: .standalone .latest + display_name: Test macOS Arm64 py3.9 NoAuth NoSSL Sync + run_on: + - macos-14-arm64 + expansions: + AUTH: noauth + SSL: nossl + TEST_SUITES: default + SKIP_CSOT_TESTS: "true" + PYTHON_BINARY: /Library/Frameworks/Python.Framework/Versions/3.9/bin/python3 - name: test-macos-arm64-py3.9-auth-ssl-async tasks: - name: .standalone .6.0 @@ -2612,123 +2547,161 @@ buildvariants: TEST_SUITES: default_async SKIP_CSOT_TESTS: "true" PYTHON_BINARY: /Library/Frameworks/Python.Framework/Versions/3.9/bin/python3 -- name: test-macos-arm64-py3.13-noauth-ssl-sync +- name: test-macos-arm64-py3.9-noauth-ssl-async tasks: - - name: .replica_set .6.0 - - name: .replica_set .7.0 - - name: .replica_set .8.0 - - name: .replica_set .rapid - - name: .replica_set .latest - display_name: Test macOS Arm64 py3.13 NoAuth SSL Sync + - name: .standalone .6.0 + - name: .standalone .7.0 + - name: .standalone .8.0 + - name: .standalone .rapid + - name: .standalone .latest + display_name: Test macOS Arm64 py3.9 NoAuth SSL Async run_on: - macos-14-arm64 expansions: AUTH: noauth SSL: ssl - TEST_SUITES: default + TEST_SUITES: default_async SKIP_CSOT_TESTS: "true" - PYTHON_BINARY: /Library/Frameworks/Python.Framework/Versions/3.13/bin/python3 -- name: test-macos-arm64-py3.13-noauth-ssl-async + PYTHON_BINARY: /Library/Frameworks/Python.Framework/Versions/3.9/bin/python3 +- name: test-macos-arm64-py3.9-noauth-nossl-async tasks: - - name: .replica_set .6.0 - - name: .replica_set .7.0 - - name: .replica_set .8.0 - - name: .replica_set .rapid - - name: .replica_set .latest - display_name: Test macOS Arm64 py3.13 NoAuth SSL Async + - name: .standalone .6.0 + - name: .standalone .7.0 + - name: .standalone .8.0 + - name: .standalone .rapid + - name: .standalone .latest + display_name: Test macOS Arm64 py3.9 NoAuth NoSSL Async run_on: - macos-14-arm64 expansions: AUTH: noauth - SSL: ssl + SSL: nossl TEST_SUITES: default_async SKIP_CSOT_TESTS: "true" + PYTHON_BINARY: /Library/Frameworks/Python.Framework/Versions/3.9/bin/python3 +- name: test-macos-arm64-py3.13-auth-ssl-sync + tasks: + - name: .sharded_cluster .6.0 + - name: .sharded_cluster .7.0 + - name: .sharded_cluster .8.0 + - name: .sharded_cluster .rapid + - name: .sharded_cluster .latest + display_name: Test macOS Arm64 py3.13 Auth SSL Sync + run_on: + - macos-14-arm64 + expansions: + AUTH: auth + SSL: ssl + TEST_SUITES: default + SKIP_CSOT_TESTS: "true" PYTHON_BINARY: /Library/Frameworks/Python.Framework/Versions/3.13/bin/python3 -- name: test-macos-arm64-py3.9-noauth-nossl-sync +- name: test-macos-arm64-py3.13-noauth-ssl-sync tasks: - name: .sharded_cluster .6.0 - name: .sharded_cluster .7.0 - name: .sharded_cluster .8.0 - name: .sharded_cluster .rapid - name: .sharded_cluster .latest - display_name: Test macOS Arm64 py3.9 NoAuth NoSSL Sync + display_name: Test macOS Arm64 py3.13 NoAuth SSL Sync run_on: - macos-14-arm64 expansions: AUTH: noauth - SSL: nossl + SSL: ssl TEST_SUITES: default SKIP_CSOT_TESTS: "true" - PYTHON_BINARY: /Library/Frameworks/Python.Framework/Versions/3.9/bin/python3 -- name: test-macos-arm64-py3.9-noauth-nossl-async + PYTHON_BINARY: /Library/Frameworks/Python.Framework/Versions/3.13/bin/python3 +- name: test-macos-arm64-py3.13-noauth-nossl-sync tasks: - name: .sharded_cluster .6.0 - name: .sharded_cluster .7.0 - name: .sharded_cluster .8.0 - name: .sharded_cluster .rapid - name: .sharded_cluster .latest - display_name: Test macOS Arm64 py3.9 NoAuth NoSSL Async + display_name: Test macOS Arm64 py3.13 NoAuth NoSSL Sync run_on: - macos-14-arm64 expansions: AUTH: noauth SSL: nossl - TEST_SUITES: default_async + TEST_SUITES: default SKIP_CSOT_TESTS: "true" - PYTHON_BINARY: /Library/Frameworks/Python.Framework/Versions/3.9/bin/python3 - -# Server tests for Windows. -- name: test-win64-py3.9-auth-ssl-sync + PYTHON_BINARY: /Library/Frameworks/Python.Framework/Versions/3.13/bin/python3 +- name: test-macos-arm64-py3.13-auth-ssl-async tasks: - - name: .standalone - display_name: Test Win64 py3.9 Auth SSL Sync + - name: .sharded_cluster .6.0 + - name: .sharded_cluster .7.0 + - name: .sharded_cluster .8.0 + - name: .sharded_cluster .rapid + - name: .sharded_cluster .latest + display_name: Test macOS Arm64 py3.13 Auth SSL Async run_on: - - windows-64-vsMulti-small + - macos-14-arm64 expansions: AUTH: auth SSL: ssl - TEST_SUITES: default - PYTHON_BINARY: C:/python/Python39/python.exe + TEST_SUITES: default_async SKIP_CSOT_TESTS: "true" -- name: test-win64-py3.9-auth-ssl-async + PYTHON_BINARY: /Library/Frameworks/Python.Framework/Versions/3.13/bin/python3 +- name: test-macos-arm64-py3.13-noauth-ssl-async tasks: - - name: .standalone - display_name: Test Win64 py3.9 Auth SSL Async + - name: .sharded_cluster .6.0 + - name: .sharded_cluster .7.0 + - name: .sharded_cluster .8.0 + - name: .sharded_cluster .rapid + - name: .sharded_cluster .latest + display_name: Test macOS Arm64 py3.13 NoAuth SSL Async run_on: - - windows-64-vsMulti-small + - macos-14-arm64 expansions: - AUTH: auth + AUTH: noauth SSL: ssl TEST_SUITES: default_async - PYTHON_BINARY: C:/python/Python39/python.exe SKIP_CSOT_TESTS: "true" -- name: test-win64-py3.13-noauth-ssl-sync + PYTHON_BINARY: /Library/Frameworks/Python.Framework/Versions/3.13/bin/python3 +- name: test-macos-arm64-py3.13-noauth-nossl-async tasks: - - name: .replica_set - display_name: Test Win64 py3.13 NoAuth SSL Sync + - name: .sharded_cluster .6.0 + - name: .sharded_cluster .7.0 + - name: .sharded_cluster .8.0 + - name: .sharded_cluster .rapid + - name: .sharded_cluster .latest + display_name: Test macOS Arm64 py3.13 NoAuth NoSSL Async run_on: - - windows-64-vsMulti-small + - macos-14-arm64 expansions: AUTH: noauth + SSL: nossl + TEST_SUITES: default_async + SKIP_CSOT_TESTS: "true" + PYTHON_BINARY: /Library/Frameworks/Python.Framework/Versions/3.13/bin/python3 +- name: test-win64-py3.9-auth-ssl-sync + tasks: + - name: .standalone + display_name: Test Win64 py3.9 Auth SSL Sync + run_on: + - windows-64-vsMulti-small + expansions: + AUTH: auth SSL: ssl TEST_SUITES: default - PYTHON_BINARY: C:/python/Python313/python.exe SKIP_CSOT_TESTS: "true" -- name: test-win64-py3.13-noauth-ssl-async + PYTHON_BINARY: C:/python/Python39/python.exe +- name: test-win64-py3.9-noauth-ssl-sync tasks: - - name: .replica_set - display_name: Test Win64 py3.13 NoAuth SSL Async + - name: .standalone + display_name: Test Win64 py3.9 NoAuth SSL Sync run_on: - windows-64-vsMulti-small expansions: AUTH: noauth SSL: ssl - TEST_SUITES: default_async - PYTHON_BINARY: C:/python/Python313/python.exe + TEST_SUITES: default SKIP_CSOT_TESTS: "true" + PYTHON_BINARY: C:/python/Python39/python.exe - name: test-win64-py3.9-noauth-nossl-sync tasks: - - name: .sharded_cluster + - name: .standalone display_name: Test Win64 py3.9 NoAuth NoSSL Sync run_on: - windows-64-vsMulti-small @@ -2736,11 +2709,35 @@ buildvariants: AUTH: noauth SSL: nossl TEST_SUITES: default + SKIP_CSOT_TESTS: "true" PYTHON_BINARY: C:/python/Python39/python.exe +- name: test-win64-py3.9-auth-ssl-async + tasks: + - name: .standalone + display_name: Test Win64 py3.9 Auth SSL Async + run_on: + - windows-64-vsMulti-small + expansions: + AUTH: auth + SSL: ssl + TEST_SUITES: default_async + SKIP_CSOT_TESTS: "true" + PYTHON_BINARY: C:/python/Python39/python.exe +- name: test-win64-py3.9-noauth-ssl-async + tasks: + - name: .standalone + display_name: Test Win64 py3.9 NoAuth SSL Async + run_on: + - windows-64-vsMulti-small + expansions: + AUTH: noauth + SSL: ssl + TEST_SUITES: default_async SKIP_CSOT_TESTS: "true" + PYTHON_BINARY: C:/python/Python39/python.exe - name: test-win64-py3.9-noauth-nossl-async tasks: - - name: .sharded_cluster + - name: .standalone display_name: Test Win64 py3.9 NoAuth NoSSL Async run_on: - windows-64-vsMulti-small @@ -2748,8 +2745,80 @@ buildvariants: AUTH: noauth SSL: nossl TEST_SUITES: default_async + SKIP_CSOT_TESTS: "true" PYTHON_BINARY: C:/python/Python39/python.exe +- name: test-win64-py3.13-auth-ssl-sync + tasks: + - name: .sharded_cluster + display_name: Test Win64 py3.13 Auth SSL Sync + run_on: + - windows-64-vsMulti-small + expansions: + AUTH: auth + SSL: ssl + TEST_SUITES: default + SKIP_CSOT_TESTS: "true" + PYTHON_BINARY: C:/python/Python313/python.exe +- name: test-win64-py3.13-noauth-ssl-sync + tasks: + - name: .sharded_cluster + display_name: Test Win64 py3.13 NoAuth SSL Sync + run_on: + - windows-64-vsMulti-small + expansions: + AUTH: noauth + SSL: ssl + TEST_SUITES: default + SKIP_CSOT_TESTS: "true" + PYTHON_BINARY: C:/python/Python313/python.exe +- name: test-win64-py3.13-noauth-nossl-sync + tasks: + - name: .sharded_cluster + display_name: Test Win64 py3.13 NoAuth NoSSL Sync + run_on: + - windows-64-vsMulti-small + expansions: + AUTH: noauth + SSL: nossl + TEST_SUITES: default + SKIP_CSOT_TESTS: "true" + PYTHON_BINARY: C:/python/Python313/python.exe +- name: test-win64-py3.13-auth-ssl-async + tasks: + - name: .sharded_cluster + display_name: Test Win64 py3.13 Auth SSL Async + run_on: + - windows-64-vsMulti-small + expansions: + AUTH: auth + SSL: ssl + TEST_SUITES: default_async + SKIP_CSOT_TESTS: "true" + PYTHON_BINARY: C:/python/Python313/python.exe +- name: test-win64-py3.13-noauth-ssl-async + tasks: + - name: .sharded_cluster + display_name: Test Win64 py3.13 NoAuth SSL Async + run_on: + - windows-64-vsMulti-small + expansions: + AUTH: noauth + SSL: ssl + TEST_SUITES: default_async + SKIP_CSOT_TESTS: "true" + PYTHON_BINARY: C:/python/Python313/python.exe +- name: test-win64-py3.13-noauth-nossl-async + tasks: + - name: .sharded_cluster + display_name: Test Win64 py3.13 NoAuth NoSSL Async + run_on: + - windows-64-vsMulti-small + expansions: + AUTH: noauth + SSL: nossl + TEST_SUITES: default_async SKIP_CSOT_TESTS: "true" + PYTHON_BINARY: C:/python/Python313/python.exe - name: test-win32-py3.9-auth-ssl-sync tasks: - name: .standalone @@ -2760,10 +2829,32 @@ buildvariants: AUTH: auth SSL: ssl TEST_SUITES: default + SKIP_CSOT_TESTS: "true" + PYTHON_BINARY: C:/python/32/Python39/python.exe +- name: test-win32-py3.9-noauth-ssl-sync + tasks: + - name: .standalone + display_name: Test Win32 py3.9 NoAuth SSL Sync + run_on: + - windows-64-vsMulti-small + expansions: + AUTH: noauth + SSL: ssl + TEST_SUITES: default + SKIP_CSOT_TESTS: "true" PYTHON_BINARY: C:/python/32/Python39/python.exe +- name: test-win32-py3.9-noauth-nossl-sync + tasks: + - name: .standalone + display_name: Test Win32 py3.9 NoAuth NoSSL Sync + run_on: + - windows-64-vsMulti-small + expansions: + AUTH: noauth + SSL: nossl + TEST_SUITES: default SKIP_CSOT_TESTS: "true" - -# Server tests for Win32. + PYTHON_BINARY: C:/python/32/Python39/python.exe - name: test-win32-py3.9-auth-ssl-async tasks: - name: .standalone @@ -2774,11 +2865,47 @@ buildvariants: AUTH: auth SSL: ssl TEST_SUITES: default_async + SKIP_CSOT_TESTS: "true" PYTHON_BINARY: C:/python/32/Python39/python.exe +- name: test-win32-py3.9-noauth-ssl-async + tasks: + - name: .standalone + display_name: Test Win32 py3.9 NoAuth SSL Async + run_on: + - windows-64-vsMulti-small + expansions: + AUTH: noauth + SSL: ssl + TEST_SUITES: default_async SKIP_CSOT_TESTS: "true" + PYTHON_BINARY: C:/python/32/Python39/python.exe +- name: test-win32-py3.9-noauth-nossl-async + tasks: + - name: .standalone + display_name: Test Win32 py3.9 NoAuth NoSSL Async + run_on: + - windows-64-vsMulti-small + expansions: + AUTH: noauth + SSL: nossl + TEST_SUITES: default_async + SKIP_CSOT_TESTS: "true" + PYTHON_BINARY: C:/python/32/Python39/python.exe +- name: test-win32-py3.13-auth-ssl-sync + tasks: + - name: .sharded_cluster + display_name: Test Win32 py3.13 Auth SSL Sync + run_on: + - windows-64-vsMulti-small + expansions: + AUTH: auth + SSL: ssl + TEST_SUITES: default + SKIP_CSOT_TESTS: "true" + PYTHON_BINARY: C:/python/32/Python313/python.exe - name: test-win32-py3.13-noauth-ssl-sync tasks: - - name: .replica_set + - name: .sharded_cluster display_name: Test Win32 py3.13 NoAuth SSL Sync run_on: - windows-64-vsMulti-small @@ -2786,44 +2913,56 @@ buildvariants: AUTH: noauth SSL: ssl TEST_SUITES: default - PYTHON_BINARY: C:/python/32/Python313/python.exe SKIP_CSOT_TESTS: "true" -- name: test-win32-py3.13-noauth-ssl-async + PYTHON_BINARY: C:/python/32/Python313/python.exe +- name: test-win32-py3.13-noauth-nossl-sync tasks: - - name: .replica_set - display_name: Test Win32 py3.13 NoAuth SSL Async + - name: .sharded_cluster + display_name: Test Win32 py3.13 NoAuth NoSSL Sync run_on: - windows-64-vsMulti-small expansions: AUTH: noauth + SSL: nossl + TEST_SUITES: default + SKIP_CSOT_TESTS: "true" + PYTHON_BINARY: C:/python/32/Python313/python.exe +- name: test-win32-py3.13-auth-ssl-async + tasks: + - name: .sharded_cluster + display_name: Test Win32 py3.13 Auth SSL Async + run_on: + - windows-64-vsMulti-small + expansions: + AUTH: auth SSL: ssl TEST_SUITES: default_async - PYTHON_BINARY: C:/python/32/Python313/python.exe SKIP_CSOT_TESTS: "true" -- name: test-win32-py3.9-noauth-nossl-sync + PYTHON_BINARY: C:/python/32/Python313/python.exe +- name: test-win32-py3.13-noauth-ssl-async tasks: - name: .sharded_cluster - display_name: Test Win32 py3.9 NoAuth NoSSL Sync + display_name: Test Win32 py3.13 NoAuth SSL Async run_on: - windows-64-vsMulti-small expansions: AUTH: noauth - SSL: nossl - TEST_SUITES: default - PYTHON_BINARY: C:/python/32/Python39/python.exe + SSL: ssl + TEST_SUITES: default_async SKIP_CSOT_TESTS: "true" -- name: test-win32-py3.9-noauth-nossl-async + PYTHON_BINARY: C:/python/32/Python313/python.exe +- name: test-win32-py3.13-noauth-nossl-async tasks: - name: .sharded_cluster - display_name: Test Win32 py3.9 NoAuth NoSSL Async + display_name: Test Win32 py3.13 NoAuth NoSSL Async run_on: - windows-64-vsMulti-small expansions: AUTH: noauth SSL: nossl TEST_SUITES: default_async - PYTHON_BINARY: C:/python/32/Python39/python.exe SKIP_CSOT_TESTS: "true" + PYTHON_BINARY: C:/python/32/Python313/python.exe # Encryption tests. - name: encryption-rhel8-py3.9-auth-ssl @@ -3168,203 +3307,587 @@ buildvariants: run_on: - rhel87-small expansions: - COMPRESSORS: zstd - NO_EXT: "1" + COMPRESSORS: zstd + NO_EXT: "1" + PYTHON_BINARY: /opt/python/3.13/bin/python3 +- name: zstd-compression-rhel8-py3.9 + tasks: + - name: .standalone !.4.0 + display_name: zstd compression RHEL8 py3.9 + run_on: + - rhel87-small + expansions: + COMPRESSORS: zstd + PYTHON_BINARY: /opt/python/3.9/bin/python3 +- name: snappy-compression-rhel8-pypy3.9 + tasks: + - name: .standalone + display_name: snappy compression RHEL8 pypy3.9 + run_on: + - rhel87-small + expansions: + COMPRESSORS: snappy + PYTHON_BINARY: /opt/python/pypy3.9/bin/python3 +- name: zlib-compression-rhel8-pypy3.10 + tasks: + - name: .standalone + display_name: zlib compression RHEL8 pypy3.10 + run_on: + - rhel87-small + expansions: + COMPRESSORS: zlib + PYTHON_BINARY: /opt/python/pypy3.10/bin/python3 +- name: zstd-compression-rhel8-pypy3.9 + tasks: + - name: .standalone !.4.0 + display_name: zstd compression RHEL8 pypy3.9 + run_on: + - rhel87-small + expansions: + COMPRESSORS: zstd + PYTHON_BINARY: /opt/python/pypy3.9/bin/python3 + +# Enterprise auth tests. +- name: enterprise-auth-macos-py3.9-auth + tasks: + - name: test-enterprise-auth + display_name: Enterprise Auth macOS py3.9 Auth + run_on: + - macos-14 + expansions: + AUTH: auth + PYTHON_BINARY: /Library/Frameworks/Python.Framework/Versions/3.9/bin/python3 +- name: enterprise-auth-rhel8-py3.10-auth + tasks: + - name: test-enterprise-auth + display_name: Enterprise Auth RHEL8 py3.10 Auth + run_on: + - rhel87-small + expansions: + AUTH: auth + PYTHON_BINARY: /opt/python/3.10/bin/python3 +- name: enterprise-auth-rhel8-py3.11-auth + tasks: + - name: test-enterprise-auth + display_name: Enterprise Auth RHEL8 py3.11 Auth + run_on: + - rhel87-small + expansions: + AUTH: auth + PYTHON_BINARY: /opt/python/3.11/bin/python3 +- name: enterprise-auth-rhel8-py3.12-auth + tasks: + - name: test-enterprise-auth + display_name: Enterprise Auth RHEL8 py3.12 Auth + run_on: + - rhel87-small + expansions: + AUTH: auth + PYTHON_BINARY: /opt/python/3.12/bin/python3 +- name: enterprise-auth-win64-py3.13-auth + tasks: + - name: test-enterprise-auth + display_name: Enterprise Auth Win64 py3.13 Auth + run_on: + - windows-64-vsMulti-small + expansions: + AUTH: auth + PYTHON_BINARY: C:/python/Python313/python.exe +- name: enterprise-auth-rhel8-pypy3.9-auth + tasks: + - name: test-enterprise-auth + display_name: Enterprise Auth RHEL8 pypy3.9 Auth + run_on: + - rhel87-small + expansions: + AUTH: auth + PYTHON_BINARY: /opt/python/pypy3.9/bin/python3 +- name: enterprise-auth-rhel8-pypy3.10-auth + tasks: + - name: test-enterprise-auth + display_name: Enterprise Auth RHEL8 pypy3.10 Auth + run_on: + - rhel87-small + expansions: + AUTH: auth + PYTHON_BINARY: /opt/python/pypy3.10/bin/python3 + +# PyOpenSSL tests. +- name: pyopenssl-macos-py3.9 + tasks: + - name: .replica_set + - name: .7.0 + display_name: PyOpenSSL macOS py3.9 + run_on: + - macos-14 + batchtime: 10080 + expansions: + AUTH: noauth + test_pyopenssl: "true" + SSL: ssl + PYTHON_BINARY: /Library/Frameworks/Python.Framework/Versions/3.9/bin/python3 +- name: pyopenssl-rhel8-py3.10 + tasks: + - name: .replica_set + - name: .7.0 + display_name: PyOpenSSL RHEL8 py3.10 + run_on: + - rhel87-small + batchtime: 10080 + expansions: + AUTH: auth + test_pyopenssl: "true" + SSL: ssl + PYTHON_BINARY: /opt/python/3.10/bin/python3 +- name: pyopenssl-rhel8-py3.11 + tasks: + - name: .replica_set + - name: .7.0 + display_name: PyOpenSSL RHEL8 py3.11 + run_on: + - rhel87-small + batchtime: 10080 + expansions: + AUTH: auth + test_pyopenssl: "true" + SSL: ssl + PYTHON_BINARY: /opt/python/3.11/bin/python3 +- name: pyopenssl-rhel8-py3.12 + tasks: + - name: .replica_set + - name: .7.0 + display_name: PyOpenSSL RHEL8 py3.12 + run_on: + - rhel87-small + batchtime: 10080 + expansions: + AUTH: auth + test_pyopenssl: "true" + SSL: ssl + PYTHON_BINARY: /opt/python/3.12/bin/python3 +- name: pyopenssl-win64-py3.13 + tasks: + - name: .replica_set + - name: .7.0 + display_name: PyOpenSSL Win64 py3.13 + run_on: + - windows-64-vsMulti-small + batchtime: 10080 + expansions: + AUTH: auth + test_pyopenssl: "true" + SSL: ssl + PYTHON_BINARY: C:/python/Python313/python.exe +- name: pyopenssl-rhel8-pypy3.9 + tasks: + - name: .replica_set + - name: .7.0 + display_name: PyOpenSSL RHEL8 pypy3.9 + run_on: + - rhel87-small + batchtime: 10080 + expansions: + AUTH: auth + test_pyopenssl: "true" + SSL: ssl + PYTHON_BINARY: /opt/python/pypy3.9/bin/python3 +- name: pyopenssl-rhel8-pypy3.10 + tasks: + - name: .replica_set + - name: .7.0 + display_name: PyOpenSSL RHEL8 pypy3.10 + run_on: + - rhel87-small + batchtime: 10080 + expansions: + AUTH: auth + test_pyopenssl: "true" + SSL: ssl + PYTHON_BINARY: /opt/python/pypy3.10/bin/python3 + +# Storage Engine tests. +- name: storage-inmemory-rhel8-py3.9 + tasks: + - name: .standalone .4.0 + - name: .standalone .4.4 + - name: .standalone .5.0 + - name: .standalone .6.0 + - name: .standalone .7.0 + - name: .standalone .8.0 + - name: .standalone .rapid + - name: .standalone .latest + display_name: Storage InMemory RHEL8 py3.9 + run_on: + - rhel87-small + expansions: + STORAGE_ENGINE: inmemory + PYTHON_BINARY: /opt/python/3.9/bin/python3 +- name: storage-mmapv1-rhel8-py3.9 + tasks: + - name: .standalone .4.0 + - name: .replica_set .4.0 + display_name: Storage MMAPv1 RHEL8 py3.9 + run_on: + - rhel87-small + expansions: + STORAGE_ENGINE: mmapv1 + PYTHON_BINARY: /opt/python/3.9/bin/python3 + +# Versioned API tests. +- name: versioned-api-require-v1-rhel8-py3.9-auth + tasks: + - name: .standalone .5.0 + - name: .standalone .6.0 + - name: .standalone .7.0 + - name: .standalone .8.0 + - name: .standalone .rapid + - name: .standalone .latest + display_name: Versioned API require v1 RHEL8 py3.9 Auth + run_on: + - rhel87-small + expansions: + AUTH: auth + REQUIRE_API_VERSION: "1" + MONGODB_API_VERSION: "1" + PYTHON_BINARY: /opt/python/3.9/bin/python3 + tags: [versionedApi_tag] +- name: versioned-api-accept-v2-rhel8-py3.9-auth + tasks: + - name: .standalone .5.0 + - name: .standalone .6.0 + - name: .standalone .7.0 + - name: .standalone .8.0 + - name: .standalone .rapid + - name: .standalone .latest + display_name: Versioned API accept v2 RHEL8 py3.9 Auth + run_on: + - rhel87-small + expansions: + AUTH: auth + ORCHESTRATION_FILE: versioned-api-testing.json + PYTHON_BINARY: /opt/python/3.9/bin/python3 + tags: [versionedApi_tag] +- name: versioned-api-require-v1-rhel8-py3.13-auth + tasks: + - name: .standalone .5.0 + - name: .standalone .6.0 + - name: .standalone .7.0 + - name: .standalone .8.0 + - name: .standalone .rapid + - name: .standalone .latest + display_name: Versioned API require v1 RHEL8 py3.13 Auth + run_on: + - rhel87-small + expansions: + AUTH: auth + REQUIRE_API_VERSION: "1" + MONGODB_API_VERSION: "1" + PYTHON_BINARY: /opt/python/3.13/bin/python3 + tags: [versionedApi_tag] +- name: versioned-api-accept-v2-rhel8-py3.13-auth + tasks: + - name: .standalone .5.0 + - name: .standalone .6.0 + - name: .standalone .7.0 + - name: .standalone .8.0 + - name: .standalone .rapid + - name: .standalone .latest + display_name: Versioned API accept v2 RHEL8 py3.13 Auth + run_on: + - rhel87-small + expansions: + AUTH: auth + ORCHESTRATION_FILE: versioned-api-testing.json PYTHON_BINARY: /opt/python/3.13/bin/python3 -- name: zstd-compression-rhel8-py3.9 + tags: [versionedApi_tag] + +# Green framework tests. +- name: eventlet-rhel8-py3.9 tasks: - - name: .standalone !.4.0 - display_name: zstd compression RHEL8 py3.9 + - name: .standalone + display_name: Eventlet RHEL8 py3.9 run_on: - rhel87-small expansions: - COMPRESSORS: zstd + GREEN_FRAMEWORK: eventlet + AUTH: auth + SSL: ssl PYTHON_BINARY: /opt/python/3.9/bin/python3 -- name: snappy-compression-rhel8-pypy3.9 +- name: gevent-rhel8-py3.9 tasks: - name: .standalone - display_name: snappy compression RHEL8 pypy3.9 + display_name: Gevent RHEL8 py3.9 run_on: - rhel87-small expansions: - COMPRESSORS: snappy - PYTHON_BINARY: /opt/python/pypy3.9/bin/python3 -- name: zlib-compression-rhel8-pypy3.10 + GREEN_FRAMEWORK: gevent + AUTH: auth + SSL: ssl + PYTHON_BINARY: /opt/python/3.9/bin/python3 +- name: eventlet-rhel8-py3.12 tasks: - name: .standalone - display_name: zlib compression RHEL8 pypy3.10 + display_name: Eventlet RHEL8 py3.12 run_on: - rhel87-small expansions: - COMPRESSORS: zlib - PYTHON_BINARY: /opt/python/pypy3.10/bin/python3 -- name: zstd-compression-rhel8-pypy3.9 + GREEN_FRAMEWORK: eventlet + AUTH: auth + SSL: ssl + PYTHON_BINARY: /opt/python/3.12/bin/python3 +- name: gevent-rhel8-py3.12 tasks: - - name: .standalone !.4.0 - display_name: zstd compression RHEL8 pypy3.9 + - name: .standalone + display_name: Gevent RHEL8 py3.12 run_on: - rhel87-small expansions: - COMPRESSORS: zstd - PYTHON_BINARY: /opt/python/pypy3.9/bin/python3 + GREEN_FRAMEWORK: gevent + AUTH: auth + SSL: ssl + PYTHON_BINARY: /opt/python/3.12/bin/python3 -# Enterprise auth tests. -- name: enterprise-auth-macos-py3.9-auth +# No C Ext tests. +- name: no-c-ext-rhel8-py3.9 tasks: - - name: test-enterprise-auth - display_name: Enterprise Auth macOS py3.9 Auth + - name: .standalone + display_name: No C Ext RHEL8 py3.9 run_on: - - macos-14 + - rhel87-small expansions: - AUTH: auth - PYTHON_BINARY: /Library/Frameworks/Python.Framework/Versions/3.9/bin/python3 -- name: enterprise-auth-rhel8-py3.10-auth + NO_EXT: "1" + PYTHON_BINARY: /opt/python/3.9/bin/python3 +- name: no-c-ext-rhel8-py3.10 tasks: - - name: test-enterprise-auth - display_name: Enterprise Auth RHEL8 py3.10 Auth + - name: .replica_set + display_name: No C Ext RHEL8 py3.10 run_on: - rhel87-small expansions: - AUTH: auth + NO_EXT: "1" PYTHON_BINARY: /opt/python/3.10/bin/python3 -- name: enterprise-auth-rhel8-py3.11-auth +- name: no-c-ext-rhel8-py3.11 tasks: - - name: test-enterprise-auth - display_name: Enterprise Auth RHEL8 py3.11 Auth + - name: .sharded_cluster + display_name: No C Ext RHEL8 py3.11 run_on: - rhel87-small expansions: - AUTH: auth + NO_EXT: "1" PYTHON_BINARY: /opt/python/3.11/bin/python3 -- name: enterprise-auth-rhel8-py3.12-auth +- name: no-c-ext-rhel8-py3.12 tasks: - - name: test-enterprise-auth - display_name: Enterprise Auth RHEL8 py3.12 Auth + - name: .standalone + display_name: No C Ext RHEL8 py3.12 run_on: - rhel87-small expansions: - AUTH: auth + NO_EXT: "1" PYTHON_BINARY: /opt/python/3.12/bin/python3 -- name: enterprise-auth-win64-py3.13-auth +- name: no-c-ext-rhel8-py3.13 tasks: - - name: test-enterprise-auth - display_name: Enterprise Auth Win64 py3.13 Auth + - name: .replica_set + display_name: No C Ext RHEL8 py3.13 run_on: - - windows-64-vsMulti-small + - rhel87-small expansions: - AUTH: auth - PYTHON_BINARY: C:/python/Python313/python.exe -- name: enterprise-auth-rhel8-pypy3.9-auth + NO_EXT: "1" + PYTHON_BINARY: /opt/python/3.13/bin/python3 + +# Atlas Data Lake tests. +- name: atlas-data-lake-rhel8-py3.9-no-c tasks: - - name: test-enterprise-auth - display_name: Enterprise Auth RHEL8 pypy3.9 Auth + - name: atlas-data-lake-tests + display_name: Atlas Data Lake RHEL8 py3.9 No C run_on: - rhel87-small expansions: - AUTH: auth - PYTHON_BINARY: /opt/python/pypy3.9/bin/python3 -- name: enterprise-auth-rhel8-pypy3.10-auth + NO_EXT: "1" + PYTHON_BINARY: /opt/python/3.9/bin/python3 +- name: atlas-data-lake-rhel8-py3.9 tasks: - - name: test-enterprise-auth - display_name: Enterprise Auth RHEL8 pypy3.10 Auth + - name: atlas-data-lake-tests + display_name: Atlas Data Lake RHEL8 py3.9 run_on: - rhel87-small expansions: - AUTH: auth - PYTHON_BINARY: /opt/python/pypy3.10/bin/python3 - -# PyOpenSSL tests. -- name: pyopenssl-macos-py3.9 + PYTHON_BINARY: /opt/python/3.9/bin/python3 +- name: atlas-data-lake-rhel8-py3.13-no-c tasks: - - name: .replica_set - - name: .7.0 - display_name: PyOpenSSL macOS py3.9 + - name: atlas-data-lake-tests + display_name: Atlas Data Lake RHEL8 py3.13 No C run_on: - - macos-14 - batchtime: 10080 + - rhel87-small expansions: - AUTH: noauth - test_pyopenssl: "true" - SSL: ssl - PYTHON_BINARY: /Library/Frameworks/Python.Framework/Versions/3.9/bin/python3 -- name: pyopenssl-rhel8-py3.10 + NO_EXT: "1" + PYTHON_BINARY: /opt/python/3.13/bin/python3 +- name: atlas-data-lake-rhel8-py3.13 tasks: - - name: .replica_set - - name: .7.0 - display_name: PyOpenSSL RHEL8 py3.10 + - name: atlas-data-lake-tests + display_name: Atlas Data Lake RHEL8 py3.13 run_on: - rhel87-small - batchtime: 10080 expansions: - AUTH: auth - test_pyopenssl: "true" - SSL: ssl - PYTHON_BINARY: /opt/python/3.10/bin/python3 -- name: pyopenssl-rhel8-py3.11 + PYTHON_BINARY: /opt/python/3.13/bin/python3 + +# Mod_wsgi tests. +- name: mod_wsgi-ubuntu-22-py3.9 tasks: - - name: .replica_set - - name: .7.0 - display_name: PyOpenSSL RHEL8 py3.11 + - name: mod-wsgi-standalone + - name: mod-wsgi-replica-set + - name: mod-wsgi-embedded-mode-standalone + - name: mod-wsgi-embedded-mode-replica-set + display_name: mod_wsgi Ubuntu-22 py3.9 run_on: - - rhel87-small - batchtime: 10080 + - ubuntu2204-small expansions: - AUTH: auth - test_pyopenssl: "true" - SSL: ssl - PYTHON_BINARY: /opt/python/3.11/bin/python3 -- name: pyopenssl-rhel8-py3.12 + MOD_WSGI_VERSION: "4" + PYTHON_BINARY: /opt/python/3.9/bin/python3 +- name: mod_wsgi-ubuntu-22-py3.13 tasks: - - name: .replica_set - - name: .7.0 - display_name: PyOpenSSL RHEL8 py3.12 + - name: mod-wsgi-standalone + - name: mod-wsgi-replica-set + - name: mod-wsgi-embedded-mode-standalone + - name: mod-wsgi-embedded-mode-replica-set + display_name: mod_wsgi Ubuntu-22 py3.13 run_on: - - rhel87-small - batchtime: 10080 + - ubuntu2204-small expansions: - AUTH: auth - test_pyopenssl: "true" - SSL: ssl - PYTHON_BINARY: /opt/python/3.12/bin/python3 -- name: pyopenssl-win64-py3.13 + MOD_WSGI_VERSION: "4" + PYTHON_BINARY: /opt/python/3.13/bin/python3 + +# Disable test commands variants. +- name: disable-test-commands-rhel8-py3.9 tasks: - - name: .replica_set - - name: .7.0 - display_name: PyOpenSSL Win64 py3.13 + - name: .latest + display_name: Disable test commands RHEL8 py3.9 run_on: - - windows-64-vsMulti-small - batchtime: 10080 + - rhel87-small expansions: AUTH: auth - test_pyopenssl: "true" SSL: ssl - PYTHON_BINARY: C:/python/Python313/python.exe -- name: pyopenssl-rhel8-pypy3.9 + DISABLE_TEST_COMMANDS: "1" + PYTHON_BINARY: /opt/python/3.9/bin/python3 + +# Serverless variants. +- name: serverless-rhel8-py3.9 tasks: - - name: .replica_set - - name: .7.0 - display_name: PyOpenSSL RHEL8 pypy3.9 + - name: serverless_task_group + display_name: Serverless RHEL8 py3.9 run_on: - rhel87-small batchtime: 10080 expansions: + test_serverless: "true" AUTH: auth - test_pyopenssl: "true" SSL: ssl - PYTHON_BINARY: /opt/python/pypy3.9/bin/python3 -- name: pyopenssl-rhel8-pypy3.10 + PYTHON_BINARY: /opt/python/3.9/bin/python3 +- name: serverless-rhel8-py3.13 tasks: - - name: .replica_set - - name: .7.0 - display_name: PyOpenSSL RHEL8 pypy3.10 + - name: serverless_task_group + display_name: Serverless RHEL8 py3.13 run_on: - rhel87-small batchtime: 10080 expansions: + test_serverless: "true" AUTH: auth - test_pyopenssl: "true" SSL: ssl - PYTHON_BINARY: /opt/python/pypy3.10/bin/python3 + PYTHON_BINARY: /opt/python/3.13/bin/python3 + +# AWS Auth tests. +- name: aws-auth-ubuntu-20-py3.9 + tasks: + - name: aws-auth-test-4.4 + - name: aws-auth-test-5.0 + - name: aws-auth-test-6.0 + - name: aws-auth-test-7.0 + - name: aws-auth-test-8.0 + - name: aws-auth-test-rapid + - name: aws-auth-test-latest + display_name: AWS Auth Ubuntu-20 py3.9 + run_on: + - ubuntu2004-small + expansions: + PYTHON_BINARY: /opt/python/3.9/bin/python3 +- name: aws-auth-ubuntu-20-py3.13 + tasks: + - name: aws-auth-test-4.4 + - name: aws-auth-test-5.0 + - name: aws-auth-test-6.0 + - name: aws-auth-test-7.0 + - name: aws-auth-test-8.0 + - name: aws-auth-test-rapid + - name: aws-auth-test-latest + display_name: AWS Auth Ubuntu-20 py3.13 + run_on: + - ubuntu2004-small + expansions: + PYTHON_BINARY: /opt/python/3.13/bin/python3 +- name: aws-auth-win64-py3.9 + tasks: + - name: aws-auth-test-4.4 + - name: aws-auth-test-5.0 + - name: aws-auth-test-6.0 + - name: aws-auth-test-7.0 + - name: aws-auth-test-8.0 + - name: aws-auth-test-rapid + - name: aws-auth-test-latest + display_name: AWS Auth Win64 py3.9 + run_on: + - windows-64-vsMulti-small + expansions: + skip_ECS_auth_test: "true" + PYTHON_BINARY: C:/python/Python39/python.exe +- name: aws-auth-win64-py3.13 + tasks: + - name: aws-auth-test-4.4 + - name: aws-auth-test-5.0 + - name: aws-auth-test-6.0 + - name: aws-auth-test-7.0 + - name: aws-auth-test-8.0 + - name: aws-auth-test-rapid + - name: aws-auth-test-latest + display_name: AWS Auth Win64 py3.13 + run_on: + - windows-64-vsMulti-small + expansions: + skip_ECS_auth_test: "true" + PYTHON_BINARY: C:/python/Python313/python.exe +- name: aws-auth-macos-py3.9 + tasks: + - name: aws-auth-test-4.4 + - name: aws-auth-test-5.0 + - name: aws-auth-test-6.0 + - name: aws-auth-test-7.0 + - name: aws-auth-test-8.0 + - name: aws-auth-test-rapid + - name: aws-auth-test-latest + display_name: AWS Auth macOS py3.9 + run_on: + - macos-14 + expansions: + skip_ECS_auth_test: "true" + skip_EC2_auth_test: "true" + skip_web_identity_auth_test: "true" + PYTHON_BINARY: /Library/Frameworks/Python.Framework/Versions/3.9/bin/python3 +- name: aws-auth-macos-py3.13 + tasks: + - name: aws-auth-test-4.4 + - name: aws-auth-test-5.0 + - name: aws-auth-test-6.0 + - name: aws-auth-test-7.0 + - name: aws-auth-test-8.0 + - name: aws-auth-test-rapid + - name: aws-auth-test-latest + display_name: AWS Auth macOS py3.13 + run_on: + - macos-14 + expansions: + skip_ECS_auth_test: "true" + skip_EC2_auth_test: "true" + skip_web_identity_auth_test: "true" + PYTHON_BINARY: /Library/Frameworks/Python.Framework/Versions/3.13/bin/python3 - matrix_name: "tests-fips" matrix_spec: @@ -3388,47 +3911,6 @@ buildvariants: tasks: - ".6.0" -- matrix_name: "tests-python-version-rhel8-without-c-extensions" - matrix_spec: - platform: rhel8 - python-version: "*" - c-extensions: without-c-extensions - auth-ssl: noauth-nossl - coverage: "*" - exclude_spec: - # These interpreters are always tested without extensions. - - platform: rhel8 - python-version: ["pypy3.9", "pypy3.10"] - c-extensions: "*" - auth-ssl: "*" - coverage: "*" - display_name: "${c-extensions} ${python-version} ${platform} ${auth} ${ssl} ${coverage}" - tasks: &all-server-versions - - ".rapid" - - ".latest" - - ".8.0" - - ".7.0" - - ".6.0" - - ".5.0" - - ".4.4" - - ".4.2" - - ".4.0" - -- matrix_name: "tests-python-version-green-framework-rhel8" - matrix_spec: - platform: rhel8 - python-version: "*" - green-framework: "*" - auth-ssl: "*" - exclude_spec: - # Don't test green frameworks on these Python versions. - - platform: rhel8 - python-version: ["pypy3.9", "pypy3.10", "3.13"] - green-framework: "*" - auth-ssl: "*" - display_name: "${green-framework} ${python-version} ${platform} ${auth-ssl}" - tasks: *all-server-versions - - matrix_name: "tests-python-version-supports-openssl-102-test-ssl" matrix_spec: platform: rhel7 @@ -3439,48 +3921,6 @@ buildvariants: tasks: - ".5.0" -# Storage engine tests on RHEL 8.4 (x86_64) with Python 3.9. -- matrix_name: "tests-storage-engines" - matrix_spec: - platform: rhel8 - storage-engine: "*" - python-version: "3.9" - display_name: "Storage ${storage-engine} ${python-version} ${platform}" - rules: - - if: - platform: rhel8 - storage-engine: ["inmemory"] - python-version: "*" - then: - add_tasks: - - "test-latest-standalone" - - "test-8.0-standalone" - - "test-7.0-standalone" - - "test-6.0-standalone" - - "test-5.0-standalone" - - "test-4.4-standalone" - - "test-4.2-standalone" - - "test-4.0-standalone" - - if: - # MongoDB 4.2 drops support for MMAPv1 - platform: rhel8 - storage-engine: ["mmapv1"] - python-version: "*" - then: - add_tasks: - - "test-4.0-standalone" - - "test-4.0-replica_set" - -# enableTestCommands=0 tests on RHEL 8.4 (x86_64) with Python 3.9. -- matrix_name: "test-disableTestCommands" - matrix_spec: - platform: rhel8 - disableTestCommands: "*" - python-version: "3.9" - display_name: "Disable test commands ${python-version} ${platform}" - tasks: - - ".latest" - - matrix_name: "test-search-index-helpers" matrix_spec: platform: rhel8 @@ -3489,18 +3929,6 @@ buildvariants: tasks: - name: "test_atlas_task_group_search_indexes" -- matrix_name: "tests-mod-wsgi" - matrix_spec: - platform: ubuntu-22.04 - python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] - mod-wsgi-version: "*" - display_name: "${mod-wsgi-version} ${python-version} ${platform}" - tasks: - - name: "mod-wsgi-standalone" - - name: "mod-wsgi-replica-set" - - name: "mod-wsgi-embedded-mode-standalone" - - name: "mod-wsgi-embedded-mode-replica-set" - - matrix_name: "mockupdb-tests" matrix_spec: platform: rhel8 @@ -3539,42 +3967,6 @@ buildvariants: tasks: - name: "atlas-connect" -- matrix_name: "serverless" - matrix_spec: - platform: rhel8 - python-version: "*" - auth-ssl: auth-ssl - serverless: "enabled" - display_name: "${serverless} ${python-version} ${platform}" - tasks: - - "serverless_task_group" - -- matrix_name: "data-lake-spec-tests" - matrix_spec: - platform: ubuntu-22.04 - python-version: ["3.9", "3.10"] - auth: "auth" - c-extensions: "*" - display_name: "Atlas Data Lake ${python-version} ${c-extensions}" - tasks: - - name: atlas-data-lake-tests - -- matrix_name: "stable-api-tests" - matrix_spec: - platform: rhel8 - python-version: ["3.9", "3.10"] - auth: "auth" - versionedApi: "*" - display_name: "Versioned API ${versionedApi} ${python-version}" - batchtime: 10080 # 7 days - tasks: - # Versioned API was introduced in MongoDB 4.7 - - "test-latest-standalone" - - "test-8.0-standalone" - - "test-7.0-standalone" - - "test-6.0-standalone" - - "test-5.0-standalone" - # OCSP test matrix. - name: ocsp-test-rhel8-v4.4-py3.9 tasks: @@ -3939,47 +4331,6 @@ buildvariants: - name: testgcpoidc_task_group batchtime: 20160 # Use a batchtime of 14 days as suggested by the CSFLE test README -- matrix_name: "aws-auth-test" - matrix_spec: - platform: [ubuntu-20.04] - python-version: ["3.9"] - display_name: "MONGODB-AWS Auth ${platform} ${python-version}" - tasks: - - name: "aws-auth-test-4.4" - - name: "aws-auth-test-5.0" - - name: "aws-auth-test-6.0" - - name: "aws-auth-test-7.0" - - name: "aws-auth-test-8.0" - - name: "aws-auth-test-rapid" - - name: "aws-auth-test-latest" - -- matrix_name: "aws-auth-test-mac" - matrix_spec: - platform: [macos] - display_name: "MONGODB-AWS Auth ${platform} ${python-version-mac}" - tasks: - - name: "aws-auth-test-4.4" - - name: "aws-auth-test-5.0" - - name: "aws-auth-test-6.0" - - name: "aws-auth-test-7.0" - - name: "aws-auth-test-8.0" - - name: "aws-auth-test-rapid" - - name: "aws-auth-test-latest" - -- matrix_name: "aws-auth-test-windows" - matrix_spec: - platform: [windows] - python-version-windows: "*" - display_name: "MONGODB-AWS Auth ${platform} ${python-version-windows}" - tasks: - - name: "aws-auth-test-4.4" - - name: "aws-auth-test-5.0" - - name: "aws-auth-test-6.0" - - name: "aws-auth-test-7.0" - - name: "aws-auth-test-8.0" - - name: "aws-auth-test-rapid" - - name: "aws-auth-test-latest" - - name: testgcpkms-variant display_name: "GCP KMS" run_on: diff --git a/.evergreen/scripts/generate_config.py b/.evergreen/scripts/generate_config.py index 6d614a9afe..3f1ea724ed 100644 --- a/.evergreen/scripts/generate_config.py +++ b/.evergreen/scripts/generate_config.py @@ -23,7 +23,6 @@ ############## ALL_VERSIONS = ["4.0", "4.4", "5.0", "6.0", "7.0", "8.0", "rapid", "latest"] -VERSIONS_6_0_PLUS = ["6.0", "7.0", "8.0", "rapid", "latest"] CPYTHONS = ["3.9", "3.10", "3.11", "3.12", "3.13"] PYPYS = ["pypy3.9", "pypy3.10"] ALL_PYTHONS = CPYTHONS + PYPYS @@ -55,6 +54,8 @@ class Host: HOSTS["win32"] = Host("win32", "windows-64-vsMulti-small", "Win32") HOSTS["macos"] = Host("macos", "macos-14", "macOS") HOSTS["macos-arm64"] = Host("macos-arm64", "macos-14-arm64", "macOS Arm64") +HOSTS["ubuntu20"] = Host("ubuntu20", "ubuntu2004-small", "Ubuntu-20") +HOSTS["ubuntu22"] = Host("ubuntu22", "ubuntu2204-small", "Ubuntu-22") ############## @@ -103,7 +104,7 @@ def get_python_binary(python: str, host: str) -> str: python = python.replace(".", "") return f"{base}/Python{python}/python.exe" - if host == "rhel8": + if host in ["rhel8", "ubuntu22", "ubuntu20"]: return f"/opt/python/{python}/bin/python3" if host in ["macos", "macos-arm64"]: @@ -112,6 +113,24 @@ def get_python_binary(python: str, host: str) -> str: raise ValueError(f"no match found for python {python} on {host}") +def get_versions_from(min_version: str) -> list[str]: + """Get all server versions starting from a minimum version.""" + min_version_float = float(min_version) + rapid_latest = ["rapid", "latest"] + versions = [v for v in ALL_VERSIONS if v not in rapid_latest] + return [v for v in versions if float(v) >= min_version_float] + rapid_latest + + +def get_versions_until(max_version: str) -> list[str]: + """Get all server version up to a max version.""" + max_version_float = float(max_version) + versions = [v for v in ALL_VERSIONS if v not in ["rapid", "latest"]] + versions = [v for v in versions if float(v) <= max_version_float] + if not len(versions): + raise ValueError(f"No server versions found less <= {max_version}") + return versions + + def get_display_name(base: str, host: str, **kwargs) -> str: """Get the display name of a variant.""" display_name = f"{base} {HOSTS[host].display_name}" @@ -236,14 +255,17 @@ def create_server_variants() -> list[BuildVariant]: # Test a subset on each of the other platforms. for host in ("macos", "macos-arm64", "win64", "win32"): - for (python, (auth, ssl), topology), sync in product( - zip_cycle(MIN_MAX_PYTHON, AUTH_SSLS, TOPOLOGIES), SYNCS - ): + for ( + python, + sync, + (auth, ssl), + ) in product(MIN_MAX_PYTHON, SYNCS, AUTH_SSLS): test_suite = "default" if sync == "sync" else "default_async" + topology = TOPOLOGIES[0] if python == CPYTHONS[0] else TOPOLOGIES[-1] tasks = [f".{topology}"] # MacOS arm64 only works on server versions 6.0+ if host == "macos-arm64": - tasks = [f".{topology} .{version}" for version in VERSIONS_6_0_PLUS] + tasks = [f".{topology} .{version}" for version in get_versions_from("6.0")] expansions = dict(AUTH=auth, SSL=ssl, TEST_SUITES=test_suite, SKIP_CSOT_TESTS="true") display_name = get_display_name("Test", host, python=python, **expansions) variant = create_variant( @@ -330,7 +352,7 @@ def create_load_balancer_variants(): task_names = ["load-balancer-test"] batchtime = BATCHTIME_WEEK expansions_base = dict(test_loadbalancer="true") - versions = ["6.0", "7.0", "8.0", "latest", "rapid"] + versions = get_versions_from("6.0") variants = [] pythons = CPYTHONS + PYPYS for ind, (version, (auth, ssl)) in enumerate(product(versions, AUTH_SSLS)): @@ -442,10 +464,186 @@ def create_pyopenssl_variants(): return variants +def create_storage_engine_tests(): + host = "rhel8" + engines = ["InMemory", "MMAPv1"] + variants = [] + for engine in engines: + python = CPYTHONS[0] + expansions = dict(STORAGE_ENGINE=engine.lower()) + if engine == engines[0]: + tasks = [f".standalone .{v}" for v in ALL_VERSIONS] + else: + # MongoDB 4.2 drops support for MMAPv1 + versions = get_versions_until("4.0") + tasks = [f".standalone .{v}" for v in versions] + [ + f".replica_set .{v}" for v in versions + ] + display_name = get_display_name(f"Storage {engine}", host, python=python) + variant = create_variant( + tasks, display_name, host=host, python=python, expansions=expansions + ) + variants.append(variant) + return variants + + +def create_versioned_api_tests(): + host = "rhel8" + tags = ["versionedApi_tag"] + tasks = [f".standalone .{v}" for v in get_versions_from("5.0")] + variants = [] + types = ["require v1", "accept v2"] + + # All python versions across platforms. + for python, test_type in product(MIN_MAX_PYTHON, types): + expansions = dict(AUTH="auth") + # Test against a cluster with requireApiVersion=1. + if test_type == types[0]: + # REQUIRE_API_VERSION is set to make drivers-evergreen-tools + # start a cluster with the requireApiVersion parameter. + expansions["REQUIRE_API_VERSION"] = "1" + # MONGODB_API_VERSION is the apiVersion to use in the test suite. + expansions["MONGODB_API_VERSION"] = "1" + else: + # Test against a cluster with acceptApiVersion2 but without + # requireApiVersion, and don't automatically add apiVersion to + # clients created in the test suite. + expansions["ORCHESTRATION_FILE"] = "versioned-api-testing.json" + base_display_name = f"Versioned API {test_type}" + display_name = get_display_name(base_display_name, host, python=python, **expansions) + variant = create_variant( + tasks, display_name, host=host, python=python, tags=tags, expansions=expansions + ) + variants.append(variant) + + return variants + + +def create_green_framework_variants(): + variants = [] + tasks = [".standalone"] + host = "rhel8" + for python, framework in product([CPYTHONS[0], CPYTHONS[-2]], ["eventlet", "gevent"]): + expansions = dict(GREEN_FRAMEWORK=framework, AUTH="auth", SSL="ssl") + display_name = get_display_name(f"{framework.capitalize()}", host, python=python) + variant = create_variant( + tasks, display_name, host=host, python=python, expansions=expansions + ) + variants.append(variant) + return variants + + +def generate_no_c_ext_variants(): + variants = [] + host = "rhel8" + for python, topology in zip_cycle(CPYTHONS, TOPOLOGIES): + tasks = [f".{topology}"] + expansions = dict() + handle_c_ext(C_EXTS[0], expansions) + display_name = get_display_name("No C Ext", host, python=python) + variant = create_variant( + tasks, display_name, host=host, python=python, expansions=expansions + ) + variants.append(variant) + return variants + + +def generate_atlas_data_lake_variants(): + variants = [] + host = "rhel8" + for python, c_ext in product(MIN_MAX_PYTHON, C_EXTS): + tasks = ["atlas-data-lake-tests"] + expansions = dict() + handle_c_ext(c_ext, expansions) + display_name = get_display_name("Atlas Data Lake", host, python=python, **expansions) + variant = create_variant( + tasks, display_name, host=host, python=python, expansions=expansions + ) + variants.append(variant) + return variants + + +def generate_mod_wsgi_variants(): + variants = [] + host = "ubuntu22" + tasks = [ + "mod-wsgi-standalone", + "mod-wsgi-replica-set", + "mod-wsgi-embedded-mode-standalone", + "mod-wsgi-embedded-mode-replica-set", + ] + expansions = dict(MOD_WSGI_VERSION="4") + for python in MIN_MAX_PYTHON: + display_name = get_display_name("mod_wsgi", host, python=python) + variant = create_variant( + tasks, display_name, host=host, python=python, expansions=expansions + ) + variants.append(variant) + return variants + + +def generate_disable_test_commands_variants(): + host = "rhel8" + expansions = dict(AUTH="auth", SSL="ssl", DISABLE_TEST_COMMANDS="1") + python = CPYTHONS[0] + display_name = get_display_name("Disable test commands", host, python=python) + tasks = [".latest"] + return [create_variant(tasks, display_name, host=host, python=python, expansions=expansions)] + + +def generate_serverless_variants(): + host = "rhel8" + batchtime = BATCHTIME_WEEK + expansions = dict(test_serverless="true", AUTH="auth", SSL="ssl") + tasks = ["serverless_task_group"] + base_name = "Serverless" + return [ + create_variant( + tasks, + get_display_name(base_name, host, python=python), + host=host, + python=python, + expansions=expansions, + batchtime=batchtime, + ) + for python in MIN_MAX_PYTHON + ] + + +def generate_aws_auth_variants(): + variants = [] + tasks = [ + "aws-auth-test-4.4", + "aws-auth-test-5.0", + "aws-auth-test-6.0", + "aws-auth-test-7.0", + "aws-auth-test-8.0", + "aws-auth-test-rapid", + "aws-auth-test-latest", + ] + + for host, python in product(["ubuntu20", "win64", "macos"], MIN_MAX_PYTHON): + expansions = dict() + if host != "ubuntu20": + expansions["skip_ECS_auth_test"] = "true" + if host == "macos": + expansions["skip_EC2_auth_test"] = "true" + expansions["skip_web_identity_auth_test"] = "true" + variant = create_variant( + tasks, + get_display_name("AWS Auth", host, python=python), + host=host, + python=python, + expansions=expansions, + ) + variants.append(variant) + return variants + + ################## # Generate Config ################## -variants = create_pyopenssl_variants() +variants = create_server_variants() # print(len(variants)) generate_yaml(variants=variants) diff --git a/pymongo/asynchronous/mongo_client.py b/pymongo/asynchronous/mongo_client.py index a33246a24b..c63d0fc3fc 100644 --- a/pymongo/asynchronous/mongo_client.py +++ b/pymongo/asynchronous/mongo_client.py @@ -32,6 +32,7 @@ """ from __future__ import annotations +import asyncio import contextlib import os import warnings @@ -2036,6 +2037,8 @@ async def _process_kill_cursors(self) -> None: for address, cursor_id, conn_mgr in pinned_cursors: try: await self._cleanup_cursor_lock(cursor_id, address, conn_mgr, None, False) + except asyncio.CancelledError: + raise except Exception as exc: if isinstance(exc, InvalidOperation) and self._topology._closed: # Raise the exception when client is closed so that it @@ -2050,6 +2053,8 @@ async def _process_kill_cursors(self) -> None: for address, cursor_ids in address_to_cursor_ids.items(): try: await self._kill_cursors(cursor_ids, address, topology, session=None) + except asyncio.CancelledError: + raise except Exception as exc: if isinstance(exc, InvalidOperation) and self._topology._closed: raise @@ -2064,6 +2069,8 @@ async def _process_periodic_tasks(self) -> None: try: await self._process_kill_cursors() await self._topology.update_pool() + except asyncio.CancelledError: + raise except Exception as exc: if isinstance(exc, InvalidOperation) and self._topology._closed: return diff --git a/pymongo/asynchronous/monitor.py b/pymongo/asynchronous/monitor.py index bbfd6a2998..780704fabb 100644 --- a/pymongo/asynchronous/monitor.py +++ b/pymongo/asynchronous/monitor.py @@ -16,6 +16,7 @@ from __future__ import annotations +import asyncio import atexit import logging import time @@ -26,7 +27,7 @@ from pymongo._csot import MovingMinimum from pymongo.errors import NetworkTimeout, NotPrimaryError, OperationFailure, _OperationCancelled from pymongo.hello import Hello -from pymongo.lock import _create_lock +from pymongo.lock import _async_create_lock from pymongo.logger import _SDAM_LOGGER, _debug_log, _SDAMStatusMessage from pymongo.periodic_executor import _shutdown_executors from pymongo.pool_options import _is_faas @@ -276,7 +277,7 @@ async def _check_server(self) -> ServerDescription: await self._reset_connection() if isinstance(error, _OperationCancelled): raise - self._rtt_monitor.reset() + await self._rtt_monitor.reset() # Server type defaults to Unknown. return ServerDescription(address, error=error) @@ -315,9 +316,9 @@ async def _check_once(self) -> ServerDescription: self._cancel_context = conn.cancel_context response, round_trip_time = await self._check_with_socket(conn) if not response.awaitable: - self._rtt_monitor.add_sample(round_trip_time) + await self._rtt_monitor.add_sample(round_trip_time) - avg_rtt, min_rtt = self._rtt_monitor.get() + avg_rtt, min_rtt = await self._rtt_monitor.get() sd = ServerDescription(address, response, avg_rtt, min_round_trip_time=min_rtt) if self._publish: assert self._listeners is not None @@ -413,6 +414,8 @@ def _get_seedlist(self) -> Optional[list[tuple[str, Any]]]: if len(seedlist) == 0: # As per the spec: this should be treated as a failure. raise Exception + except asyncio.CancelledError: + raise except Exception: # As per the spec, upon encountering an error: # - An error must not be raised @@ -441,7 +444,7 @@ def __init__(self, topology: Topology, topology_settings: TopologySettings, pool self._pool = pool self._moving_average = MovingAverage() self._moving_min = MovingMinimum() - self._lock = _create_lock() + self._lock = _async_create_lock() async def close(self) -> None: self.gc_safe_close() @@ -449,20 +452,20 @@ async def close(self) -> None: # thread has the socket checked out, it will be closed when checked in. await self._pool.reset() - def add_sample(self, sample: float) -> None: + async def add_sample(self, sample: float) -> None: """Add a RTT sample.""" - with self._lock: + async with self._lock: self._moving_average.add_sample(sample) self._moving_min.add_sample(sample) - def get(self) -> tuple[Optional[float], float]: + async def get(self) -> tuple[Optional[float], float]: """Get the calculated average, or None if no samples yet and the min.""" - with self._lock: + async with self._lock: return self._moving_average.get(), self._moving_min.get() - def reset(self) -> None: + async def reset(self) -> None: """Reset the average RTT.""" - with self._lock: + async with self._lock: self._moving_average.reset() self._moving_min.reset() @@ -472,10 +475,12 @@ async def _run(self) -> None: # heartbeat protocol (MongoDB 4.4+). # XXX: Skip check if the server is unknown? rtt = await self._ping() - self.add_sample(rtt) + await self.add_sample(rtt) except ReferenceError: # Topology was garbage-collected. await self.close() + except asyncio.CancelledError: + raise except Exception: await self._pool.reset() diff --git a/pymongo/asynchronous/pool.py b/pymongo/asynchronous/pool.py index 2fe9579aef..a37aa3b46a 100644 --- a/pymongo/asynchronous/pool.py +++ b/pymongo/asynchronous/pool.py @@ -704,6 +704,8 @@ def _close_conn(self) -> None: # shutdown. try: self.conn.close() + except asyncio.CancelledError: + raise except Exception: # noqa: S110 pass diff --git a/pymongo/network_layer.py b/pymongo/network_layer.py index aa16e85a07..377689047b 100644 --- a/pymongo/network_layer.py +++ b/pymongo/network_layer.py @@ -271,7 +271,8 @@ async def async_receive_data( ) for task in pending: task.cancel() - await asyncio.wait(pending) + if pending: + await asyncio.wait(pending) if len(done) == 0: raise socket.timeout("timed out") if read_task in done: diff --git a/pymongo/synchronous/mongo_client.py b/pymongo/synchronous/mongo_client.py index eb363f82f5..9c98a47037 100644 --- a/pymongo/synchronous/mongo_client.py +++ b/pymongo/synchronous/mongo_client.py @@ -32,6 +32,7 @@ """ from __future__ import annotations +import asyncio import contextlib import os import warnings @@ -2030,6 +2031,8 @@ def _process_kill_cursors(self) -> None: for address, cursor_id, conn_mgr in pinned_cursors: try: self._cleanup_cursor_lock(cursor_id, address, conn_mgr, None, False) + except asyncio.CancelledError: + raise except Exception as exc: if isinstance(exc, InvalidOperation) and self._topology._closed: # Raise the exception when client is closed so that it @@ -2044,6 +2047,8 @@ def _process_kill_cursors(self) -> None: for address, cursor_ids in address_to_cursor_ids.items(): try: self._kill_cursors(cursor_ids, address, topology, session=None) + except asyncio.CancelledError: + raise except Exception as exc: if isinstance(exc, InvalidOperation) and self._topology._closed: raise @@ -2058,6 +2063,8 @@ def _process_periodic_tasks(self) -> None: try: self._process_kill_cursors() self._topology.update_pool() + except asyncio.CancelledError: + raise except Exception as exc: if isinstance(exc, InvalidOperation) and self._topology._closed: return diff --git a/pymongo/synchronous/monitor.py b/pymongo/synchronous/monitor.py index a806670f2c..d82a5f976d 100644 --- a/pymongo/synchronous/monitor.py +++ b/pymongo/synchronous/monitor.py @@ -16,6 +16,7 @@ from __future__ import annotations +import asyncio import atexit import logging import time @@ -413,6 +414,8 @@ def _get_seedlist(self) -> Optional[list[tuple[str, Any]]]: if len(seedlist) == 0: # As per the spec: this should be treated as a failure. raise Exception + except asyncio.CancelledError: + raise except Exception: # As per the spec, upon encountering an error: # - An error must not be raised @@ -476,6 +479,8 @@ def _run(self) -> None: except ReferenceError: # Topology was garbage-collected. self.close() + except asyncio.CancelledError: + raise except Exception: self._pool.reset() diff --git a/pymongo/synchronous/pool.py b/pymongo/synchronous/pool.py index 6ac7b4eca9..99201b822e 100644 --- a/pymongo/synchronous/pool.py +++ b/pymongo/synchronous/pool.py @@ -702,6 +702,8 @@ def _close_conn(self) -> None: # shutdown. try: self.conn.close() + except asyncio.CancelledError: + raise except Exception: # noqa: S110 pass diff --git a/test/__init__.py b/test/__init__.py index c1944f5870..dba3312424 100644 --- a/test/__init__.py +++ b/test/__init__.py @@ -17,6 +17,7 @@ import asyncio import gc +import logging import multiprocessing import os import signal @@ -25,6 +26,7 @@ import sys import threading import time +import traceback import unittest import warnings from asyncio import iscoroutinefunction @@ -191,6 +193,8 @@ def _connect(self, host, port, **kwargs): client.close() def _init_client(self): + self.mongoses = [] + self.connection_attempts = [] self.client = self._connect(host, port) if self.client is not None: # Return early when connected to dataLake as mongohoused does not diff --git a/test/asynchronous/__init__.py b/test/asynchronous/__init__.py index 9ca5a32ffc..bed49de161 100644 --- a/test/asynchronous/__init__.py +++ b/test/asynchronous/__init__.py @@ -17,6 +17,7 @@ import asyncio import gc +import logging import multiprocessing import os import signal @@ -25,6 +26,7 @@ import sys import threading import time +import traceback import unittest import warnings from asyncio import iscoroutinefunction @@ -191,6 +193,8 @@ async def _connect(self, host, port, **kwargs): await client.close() async def _init_client(self): + self.mongoses = [] + self.connection_attempts = [] self.client = await self._connect(host, port) if self.client is not None: # Return early when connected to dataLake as mongohoused does not diff --git a/test/asynchronous/test_client.py b/test/asynchronous/test_client.py index 47cbff6d5b..292a78d645 100644 --- a/test/asynchronous/test_client.py +++ b/test/asynchronous/test_client.py @@ -2580,7 +2580,7 @@ async def test_direct_client_maintains_pool_to_arbiter(self): await async_wait_until(lambda: len(c.nodes) == 1, "connect") self.assertEqual(await c.address, ("c", 3)) # Assert that we create 1 pooled connection. - listener.wait_for_event(monitoring.ConnectionReadyEvent, 1) + await listener.async_wait_for_event(monitoring.ConnectionReadyEvent, 1) self.assertEqual(listener.event_count(monitoring.ConnectionCreatedEvent), 1) arbiter = c._topology.get_server_by_address(("c", 3)) self.assertEqual(len(arbiter.pool.conns), 1) diff --git a/test/asynchronous/test_connections_survive_primary_stepdown_spec.py b/test/asynchronous/test_connections_survive_primary_stepdown_spec.py index ffff428379..bc9638b443 100644 --- a/test/asynchronous/test_connections_survive_primary_stepdown_spec.py +++ b/test/asynchronous/test_connections_survive_primary_stepdown_spec.py @@ -44,9 +44,6 @@ class TestAsyncConnectionsSurvivePrimaryStepDown(AsyncIntegrationTest): listener: CMAPListener coll: AsyncCollection - async def asyncTearDown(self): - await reset_client_context() - @async_client_context.require_replica_set async def asyncSetUp(self): self.listener = CMAPListener() diff --git a/test/asynchronous/unified_format.py b/test/asynchronous/unified_format.py index 11b124a124..e8d1e4380f 100644 --- a/test/asynchronous/unified_format.py +++ b/test/asynchronous/unified_format.py @@ -530,11 +530,6 @@ async def asyncSetUp(self): # initialize internals self.match_evaluator = MatchEvaluatorUtil(self) - async def asyncTearDown(self): - for client in self.mongos_clients: - await client.close() - await super().asyncTearDown() - def maybe_skip_test(self, spec): # add any special-casing for skipping tests here if async_client_context.storage_engine == "mmapv1": diff --git a/test/asynchronous/utils_spec_runner.py b/test/asynchronous/utils_spec_runner.py index f0463244d7..75aa50b578 100644 --- a/test/asynchronous/utils_spec_runner.py +++ b/test/asynchronous/utils_spec_runner.py @@ -264,8 +264,6 @@ async def asyncSetUp(self) -> None: async def asyncTearDown(self) -> None: self.knobs.disable() - for client in self.mongos_clients: - await client.close() async def _set_fail_point(self, client, command_args): cmd = SON([("configureFailPoint", "failCommand")]) diff --git a/test/test_connections_survive_primary_stepdown_spec.py b/test/test_connections_survive_primary_stepdown_spec.py index 4387850a00..84ef6decd5 100644 --- a/test/test_connections_survive_primary_stepdown_spec.py +++ b/test/test_connections_survive_primary_stepdown_spec.py @@ -44,9 +44,6 @@ class TestConnectionsSurvivePrimaryStepDown(IntegrationTest): listener: CMAPListener coll: Collection - def tearDown(self): - reset_client_context() - @client_context.require_replica_set def setUp(self): self.listener = CMAPListener() diff --git a/test/unified_format.py b/test/unified_format.py index a88c51e6d5..435078989b 100644 --- a/test/unified_format.py +++ b/test/unified_format.py @@ -529,11 +529,6 @@ def setUp(self): # initialize internals self.match_evaluator = MatchEvaluatorUtil(self) - def tearDown(self): - for client in self.mongos_clients: - client.close() - super().tearDown() - def maybe_skip_test(self, spec): # add any special-casing for skipping tests here if client_context.storage_engine == "mmapv1": diff --git a/test/utils_spec_runner.py b/test/utils_spec_runner.py index 682cf0b0f8..3dea4ede1c 100644 --- a/test/utils_spec_runner.py +++ b/test/utils_spec_runner.py @@ -264,8 +264,6 @@ def setUp(self) -> None: def tearDown(self) -> None: self.knobs.disable() - for client in self.mongos_clients: - client.close() def _set_fail_point(self, client, command_args): cmd = SON([("configureFailPoint", "failCommand")])