Skip to content

PHPC-1975: Disable SKIPIF caching for skip_if_not_clean on PHP 8.1 #1261

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 24, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions tests/utils/skipif.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@
require_once __DIR__ . '/basic.inc';
require_once __DIR__ . '/tools.php';

/**
* Disables SKIPIF caching (PHP 8.1+).
*/
function disable_skipif_caching()
{
if (PHP_VERSION_ID < 80100) {
return;
}

echo "nocache\n";
}

/**
* Skips the test if the topology is a sharded cluster.
*/
Expand Down Expand Up @@ -404,6 +416,10 @@ function skip_if_not_clean($databaseName = DATABASE_NAME, $collectionName = COLL
} catch (RuntimeException $e) {
exit("skip Could not drop '$databaseName.$collectionName': " . $e->getMessage());
}

/* Since this function modifies the state of the database, we need it to run
* each time before a test. */
disable_skipif_caching();
}

function skip_if_no_getmore_failpoint()
Expand Down