Temporarily, force one round of server selection before testing for existence of lsid in a command
@@ -149,12 +149,14 @@ class MongoClientSessionSpecification extends FunctionalSpecification {
def optionsBuilder = MongoClientOptions.builder()
.addCommandListener(commandListener)
def client = new MongoClient(getMongoClientURI(optionsBuilder))
+ // TODO: Remove this once SPEC-944 is resolved
+ client.getDatabase('admin').runCommand(new BsonDocument('ping', new BsonInt32(1)))
when:
client.getDatabase('admin').runCommand(new BsonDocument('ping', new BsonInt32(1)))
then:
- def pingCommandStartedEvent = commandListener.events.get(0)
+ def pingCommandStartedEvent = commandListener.events.get(2)
(pingCommandStartedEvent as CommandStartedEvent).command.containsKey('lsid')
}
