Skip to content

Commit 06d5abd

Browse files
author
Divjot Arora
committed
skip test for < 3.6
1 parent f10249e commit 06d5abd

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

mongo/client_test.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,15 +280,23 @@ func TestClient(t *testing.T) {
280280
SetWriteConcern(writeconcern.New(writeconcern.WMajority())).SetMonitor(cmdMonitor)
281281
client, err := Connect(bgCtx, clientOpts)
282282
assert.Nil(t, err, "Connect error: %v", err)
283-
coll := client.Database("foo").Collection("bar")
283+
defer func() {
284+
_ = client.Disconnect(bgCtx)
285+
}()
284286

287+
serverVersion, err := getServerVersion(client.Database("admin"))
288+
assert.Nil(t, err, "getServerVersion error: %v", err)
289+
if compareVersions(t, serverVersion, "3.6.0") < 1 {
290+
t.Skip("skipping server version < 3.6")
291+
}
292+
293+
coll := client.Database("foo").Collection("bar")
285294
// Lower the batch size to force multiple batches.
286295
originalBatchSize := endSessionsBatchSize
287296
endSessionsBatchSize = 2
288297
defer func() {
289298
endSessionsBatchSize = originalBatchSize
290299
_ = coll.Drop(bgCtx)
291-
_ = client.Disconnect(bgCtx)
292300
}()
293301

294302
// Do an application operation and create four sessions so endSessions will execute in two batches.

0 commit comments

Comments
 (0)