Uploaded image for project: 'PHP Driver: Library'
  1. PHP Driver: Library
  2. PHPLIB-798

Use more flexible assertions for connection counts in PrimaryStepDownSpecTest

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 1.12.0
    • Affects Version/s: None
    • Component/s: None
    • None

      Since the PHP driver does not implement CMAP, the Connections Survive Primary Step Down Tests execute serverStatus to track connection counts. If any additional connections happen to be created, this could lead to assertion failures (see: task failure:

      [2022/02/25 01:33:23.235] There was 1 failure:
      [2022/02/25 01:33:23.235] 1) MongoDB\Tests\SpecTests\PrimaryStepDownSpecTest::testInterruptedAtShutdownResetConnectionPool
      [2022/02/25 01:33:23.235] Failed asserting that 195 is identical to 193.
      [2022/02/25 01:33:23.235] /data/mci/a59d2ada9e89f9a1b7d4ff1769da9880/src/tests/SpecTests/PrimaryStepDownSpecTest.php:182
      

      The "Reset Connection Pool" tests are only asserting that the driver is creating a new connection, so there should be no reason we can't make these assertions more flexible and expect serverStatus to report one or more connections instead of exactly one more.

            Assignee:
            jmikola@mongodb.com Jeremy Mikola
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: