Uploaded image for project: 'PHP Driver: Extension'
  1. PHP Driver: Extension
  2. PHPC-2064

SKIPIF output may be ignored for tests using skip_if_not_clean on PHP 8.1

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.15.0
    • Affects Version/s: None
    • Component/s: Tests
    • None

      When SkipCache::checkSkip() checks for "nocache" at the start of skipif output, it will replace all output with an empty string after finding a match. This is problematic given how we implemented skip_if_not_clean, since it always emits "nocache" as its last output on PHP 8.1+. If another skip function is called after skip_if_not_clean, its output will be ignored. That is to say, tests might not be skipped when they otherwise should.

      There are several ways to address this:

      • Change the order of any SKIPIF blocks in our test suite such that skip_if_not_clean is always called last.
      • Change skip_if_not_clean to no longer emit "nocache" directly. Rather, it can set some global flag to disable caching and we can use register_shutdown_function() to conditionally print "nocache" is printed as the final output of a SKIPIF block.
      • Change the logic in PHP's run-tests.sh script to no longer discard all SKIPIF output after matching "nocache" at the beginning of the output.

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

              Created:
              Updated:
              Resolved: