Skip to content

Merge v1.x into v2.x #1453

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

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .evergreen/config/generate-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]);

Expand Down
4 changes: 3 additions & 1 deletion tests/Operation/FindFunctionalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
use function sprintf;
use function strtr;

use const E_DEPRECATED;
use const E_USER_DEPRECATED;

abstract class TestCase extends BaseTestCase
Expand Down Expand Up @@ -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);
Expand Down
11 changes: 9 additions & 2 deletions tests/UnifiedSpecTests/ManagesFailPointsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace MongoDB\Tests\UnifiedSpecTests;

use MongoDB\Driver\Exception\ConnectionException;
use MongoDB\Driver\Server;
use MongoDB\Operation\DatabaseCommand;
use stdClass;
Expand Down Expand Up @@ -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 = [];
Expand Down
Loading