Commit 933f845b authored by Jeremy Mikola's avatar Jeremy Mikola

Skip causal consistency docs test if no secondary

parent e3d90cd7
...@@ -6,8 +6,10 @@ use MongoDB\BSON\UTCDateTime; ...@@ -6,8 +6,10 @@ use MongoDB\BSON\UTCDateTime;
use MongoDB\Client; use MongoDB\Client;
use MongoDB\Database; use MongoDB\Database;
use MongoDB\Driver\Cursor; use MongoDB\Driver\Cursor;
use MongoDB\Driver\ReadPreference;
use MongoDB\Driver\Server; use MongoDB\Driver\Server;
use MongoDB\Driver\WriteConcern; use MongoDB\Driver\WriteConcern;
use MongoDB\Driver\Exception\ConnectionTimeoutException;
use MongoDB\Operation\DropCollection; use MongoDB\Operation\DropCollection;
/** /**
...@@ -1412,6 +1414,12 @@ class DocumentationExamplesTest extends FunctionalTestCase ...@@ -1412,6 +1414,12 @@ class DocumentationExamplesTest extends FunctionalTestCase
{ {
$this->skipIfCausalConsistencyIsNotSupported(); $this->skipIfCausalConsistencyIsNotSupported();
try {
$this->manager->selectServer(new ReadPreference('secondary'));
} catch (ConnectionTimeoutException $e) {
$this->markTestSkipped('Secondary is not available');
}
// Prep // Prep
$client = new Client(static::getUri()); $client = new Client(static::getUri());
$items = $client->selectDatabase( $items = $client->selectDatabase(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment