[BF] test_dns_failures_logging

XMLWordPrintableJSON

    • Type: Build Failure
    • Resolution: Fixed
    • Priority: Unknown
    • 4.18.0
    • Affects Version/s: None
    • Component/s: Tests
    • None
    • Python Drivers
    • Not Needed
    • None
    • None
    • None
    • None
    • None
    • None

      Name of Failure:

      test.test_srv_polling.TestSrvPolling.test_dns_failures_logging — AssertionError: 0 != 1

      Link to task:

      https://spruce.corp.mongodb.com/task/mongo_python_driver_mongodb_rapid_test_server_version_python3.14t_sync_auth_nossl_sharded_cluster_4b45e4b0f21dd1be760e59c9f61c1ccfc38c2366_26_07_08_17_45_08/tests?execution=0

      Context of when and why the failure occurred:

      Failed on the mongodb-rapid python3.14t-sync-auth-nossl-sharded-cluster variant
      (rhel8.7, CPython 3.14 free-threaded build). The test is already decorated with
      @flaky(reason="PYTHON-5500", max_runs=3), but the flaky() decorator in test/utils.py disables retries whenever the test runs under CPython on Linux unless it's explicitly opted in with affects_cpython_linux=True, so the marking had no effect.

      Investigation found two real bugs behind the failure:

      1. The test's mock resolver wrapper (FunctionCallRecorder) isn't bound correctly when patched onto the resolver class, so the DNS exception the test means to inject never actually fires. An incidental exception is raised and logged instead, masking the intended scenario in this and several other SRV polling tests.

      2. The test's wait condition checks that the resolver was called, not that the failure was
      logged — a race against the SRV monitor's background thread that free-threaded CPython (python3.14t) can lose more easily than GIL builds, producing the observed `0 != 1`.

      Full analysis: https://gist.github.com/blink1073/f3f0fd05bd049e1f5647638b0067ec2e

      Stack trace:

      FAILED test/test_srv_polling.py::TestSrvPolling::test_dns_failures_logging - AssertionError: 0 != 1
      = 1 failed, 3729 passed, 726 skipped, 4575 deselected, 64 xfailed, 101 warnings, 64 subtests passed in 1156.34s (0:19:16) =
      error: Recipe `run-tests` failed on line 88 with exit code 1
      

            Assignee:
            Steve Silvester
            Reporter:
            Steve Silvester
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: