diff --git a/.evergreen/config/generate-config.php b/.evergreen/config/generate-config.php index ed2c6a28e..3629bf13f 100644 --- a/.evergreen/config/generate-config.php +++ b/.evergreen/config/generate-config.php @@ -55,7 +55,7 @@ // Test variants $allFiles[] = generateConfigs('buildvariants', 'test-variant', 'phpVersion', 'modern-php-full.yml', $supportedPhpVersions); -// TODO: Re-enable when 1.20.0 is released +// TODO: Re-enable when 2.0.0 is released // $allFiles[] = generateConfigs('buildvariants', 'test-variant', 'phpVersion', 'phpc.yml', [$latestPhpVersion]); // $allFiles[] = generateConfigs('buildvariants', 'test-variant', 'phpVersion', 'lowest.yml', [$lowestPhpVersion]); diff --git a/tests/Operation/FindFunctionalTest.php b/tests/Operation/FindFunctionalTest.php index 3b6a90218..2a64a7d71 100644 --- a/tests/Operation/FindFunctionalTest.php +++ b/tests/Operation/FindFunctionalTest.php @@ -48,7 +48,9 @@ function () use ($modifiers): void { ['modifiers' => $modifiers], ); - $operation->execute($this->getPrimaryServer()); + $this->assertDeprecated( + fn () => $operation->execute($this->getPrimaryServer()), + ); }, function (array $event) use ($expectedSort): void { $this->assertEquals($expectedSort, $event['started']->getCommand()->sort ?? null); diff --git a/tests/TestCase.php b/tests/TestCase.php index 1d965606d..4bff57e0d 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -37,6 +37,7 @@ use function sprintf; use function strtr; +use const E_DEPRECATED; use const E_USER_DEPRECATED; abstract class TestCase extends BaseTestCase @@ -166,7 +167,7 @@ protected function assertDeprecated(callable $execution): void set_error_handler(function ($errno, $errstr) use (&$errors): void { $errors[] = $errstr; - }, E_USER_DEPRECATED); + }, E_USER_DEPRECATED | E_DEPRECATED); try { call_user_func($execution); diff --git a/tests/UnifiedSpecTests/ManagesFailPointsTrait.php b/tests/UnifiedSpecTests/ManagesFailPointsTrait.php index a1c313074..2680e89ac 100644 --- a/tests/UnifiedSpecTests/ManagesFailPointsTrait.php +++ b/tests/UnifiedSpecTests/ManagesFailPointsTrait.php @@ -2,6 +2,7 @@ namespace MongoDB\Tests\UnifiedSpecTests; +use MongoDB\Driver\Exception\ConnectionException; use MongoDB\Driver\Server; use MongoDB\Operation\DatabaseCommand; use stdClass; @@ -31,8 +32,14 @@ public function configureFailPoint(stdClass $failPoint, Server $server): void public function disableFailPoints(): void { foreach ($this->failPointsAndServers as [$failPoint, $server]) { - $operation = new DatabaseCommand('admin', ['configureFailPoint' => $failPoint, 'mode' => 'off']); - $operation->execute($server); + try { + $operation = new DatabaseCommand('admin', ['configureFailPoint' => $failPoint, 'mode' => 'off']); + $operation->execute($server); + } catch (ConnectionException) { + // Retry once in case the connection was dropped by the last operation + $operation = new DatabaseCommand('admin', ['configureFailPoint' => $failPoint, 'mode' => 'off']); + $operation->execute($server); + } } $this->failPointsAndServers = [];