Use flaky decorator for timing-related tests

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • Python Drivers
    • Not Needed
    • None
    • None
    • None
    • None
    • None
    • None

      Context

      A large source of test failures is flaky timing-related tests, especially CSOT. These tend to occur with PyPy or on non-Linux hosts. We would consider using the flaky decorator using something like @flaky(max_runs=3, min_passes=2) to specify a desired pass rate. This is more desirable than skipping the tests entirely on PyPy and Mac/Windows.

      We should replace the skips from PYTHON-4649 and ensure that the legacy timeout tests use flaky as well.

      Here's an example failure on PyPy:

      https://spruce.mongodb.com/task/mongo_python_driver_mongodb_v6.0_test_server_version_pypy3.10_async_auth_nossl_replica_set_54846cd11029d6c3302fc55c2ead10041148f6a8_25_06_11_23_24_59/tests?execution=0&sortBy=STATUS&sortDir=ASC

      test.asynchronous.test_client_bulk_write.TestClientBulkWriteCSOT.test_timeout_in_multi_batch_bulk_write

      Definition of done

      Add flaky decorator where appropriate and minimize skipped tests.

      Pitfalls

      We might mask race conditions or undesirable behavior. We could wrap the flaky decorator with one that ensures the test is not flaky on Linux with CPython.

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

              Created:
              Updated: