@@ -13,6 +13,7 @@ import (
13
13
"context"
14
14
"testing"
15
15
16
+ "go.mongodb.org/mongo-driver/bson"
16
17
"go.mongodb.org/mongo-driver/event"
17
18
"go.mongodb.org/mongo-driver/internal/testutil"
18
19
"go.mongodb.org/mongo-driver/internal/testutil/assert"
@@ -29,6 +30,10 @@ func TestCSOTClientSideEncryptionProse(t *testing.T) {
29
30
30
31
mt .RunOpts ("1. maxTimeMS is not set for commands sent to mongocryptd" ,
31
32
noClientOpts , func (mt * mtest.T ) {
33
+ if testing .Short () {
34
+ mt .Skip ("skipping integration test in short mode" )
35
+ }
36
+
32
37
kmsProviders := map [string ]map [string ]interface {}{
33
38
"local" : {
34
39
"key" : localMasterKey ,
@@ -37,7 +42,7 @@ func TestCSOTClientSideEncryptionProse(t *testing.T) {
37
42
mongocryptdSpawnArgs := map [string ]interface {}{
38
43
// Pass a custom pidfilepath to ensure a new mongocryptd process is spawned.
39
44
"mongocryptdSpawnArgs" : []string {"--port=23000" , "--pidfilepath=TestCSOTClientSideEncryptionProse_1.pid" },
40
- "mongocryptdUri " : "mongodb://localhost:23000" ,
45
+ "mongocryptdURI " : "mongodb://localhost:23000" ,
41
46
// Do not use the shared library to ensure mongocryptd is spawned.
42
47
"__cryptSharedLibDisabledForTestOnly" : true ,
43
48
}
@@ -54,6 +59,11 @@ func TestCSOTClientSideEncryptionProse(t *testing.T) {
54
59
assert .Nil (mt , err , "encrypted client Disconnect error: %v" , err )
55
60
}()
56
61
62
+ // Run a Find through the encrypted client to make sure mongocryptd is started ('find' uses the
63
+ // mongocryptd and will wait for it to be active).
64
+ _ , err = encClient .Database ("test" ).Collection ("test" ).Find (context .Background (), bson.D {})
65
+ assert .Nil (mt , err , "Find error: %v" , err )
66
+
57
67
// Use a new Client to connect to 23000 where mongocryptd should be running. Use a custom
58
68
// command monitor to examine the eventual 'ping'.
59
69
var started * event.CommandStartedEvent
0 commit comments