ExportXMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • 4.19.0
    • Affects Version/s: None
    • Component/s: Tests
    • None
    • Python Drivers
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      Context

      Investigating ty's unused-awaitable rule (see
      https://gist.github.com/blink1073/a9fe43fbb2643b12ab4472836e77ee40) found 2 real
      missing-await bugs in test/asynchronous:
      * ResetPoolThread.run() (test_client.py) never awaits self._run(), so the
      pool-reset loop never executes during test_reset_during_update_pool.
      * InsertEventListener.succeeded() (test_retryable_writes.py) never awaits
      admin.command(...), so its configureFailPoint is never set.
      Both tests pass without exercising the behavior they're meant to test.

      mypy's unused-coroutine check should catch this but doesn't: mypy_test.ini
      disables no-untyped-def for test.*, and mypy skips body-checking on
      unannotated methods, which both of these are.

      Definition of done


      * Both bugs fixed; each test genuinely exercises its intended scenario
      * Full test suite passes, including the two affected tests

      Pitfalls


      * ResetPoolThread.run() needs more than await: Thread.run() has no
      running event loop, so it needs a real fix (e.g. dedicated loop in the thread, or
      drop the raw Thread)
      * Once the failpoint actually fires, test_retryable_writes.py may exercise a
      new code path, confirm it still passes and still tests what it intends

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

              Created:
              Updated:
              Resolved: