Fix test suite failures with PHP 8.6

XMLWordPrintableJSON

    • Type: Build Failure
    • Resolution: Unresolved
    • Priority: Critical - P2
    • 2.4.1
    • Affects Version/s: None
    • Component/s: None
    • None
    • 2
    • None
    • PHP Drivers
    • Not Needed
    • None
    • None
    • None
    • None
    • None
    • None

      The GitHub Actions job "Linux Tests (ubuntu-24.04, 8.6, 8.2, replica_set)" reports 7 failures. There are two root causes.

      1. run-tests.php runs tests in parallel by default since PHP 8.6

      The job log shows "Spawning 4 workers... Done" although TEST_PHP_ARGS does not contain -j. In PHP 8.5 and earlier, the default is a single
      process.

      The test suite is not parallel safe, because all workers share a single MongoDB deployment:

      • fail points
        configured with failCommand apply to the whole server, so a fail point with times: 1 can be consumed by another test
        running at the same time
      • several tests use fixed namespaces, for example the CSFLE key vault collection, so documents
        created by one test are visible to another
      • skip_if_not_clean() only checks the state before the test starts, it does
        not prevent concurrent writes

      This produces failures in tests/clientEncryption, tests/writeResult and
      tests/writeConcernError. The set of failing tests changes between runs.

      2. is_integer() is deprecated since PHP 8.6

      Six tests in tests/apm call is_integer() and now print "Deprecated: Function is_integer() is deprecated since 8.6, use is_int() instead".

      Fix

      • pass -j1 in TEST_PHP_ARGS for GitHub Actions and Evergreen, with a comment explaining that the suite cannot run in parallel against a shared server
      • replace is_integer() with is_int() in the
        affected tests

            Assignee:
            Jérôme Tamarelle
            Reporter:
            Jérôme Tamarelle
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: