Skip to content

Commit 947cf7e

Browse files
GODRIVER-2458 Fix race condition in CSE maxTimeMS prose test. (#1078)
Co-authored-by: Kevin Albertson <[email protected]>
1 parent e9e48b2 commit 947cf7e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

mongo/integration/csot_cse_prose_test.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"context"
1414
"testing"
1515

16+
"go.mongodb.org/mongo-driver/bson"
1617
"go.mongodb.org/mongo-driver/event"
1718
"go.mongodb.org/mongo-driver/internal/testutil"
1819
"go.mongodb.org/mongo-driver/internal/testutil/assert"
@@ -29,6 +30,10 @@ func TestCSOTClientSideEncryptionProse(t *testing.T) {
2930

3031
mt.RunOpts("1. maxTimeMS is not set for commands sent to mongocryptd",
3132
noClientOpts, func(mt *mtest.T) {
33+
if testing.Short() {
34+
mt.Skip("skipping integration test in short mode")
35+
}
36+
3237
kmsProviders := map[string]map[string]interface{}{
3338
"local": {
3439
"key": localMasterKey,
@@ -37,7 +42,7 @@ func TestCSOTClientSideEncryptionProse(t *testing.T) {
3742
mongocryptdSpawnArgs := map[string]interface{}{
3843
// Pass a custom pidfilepath to ensure a new mongocryptd process is spawned.
3944
"mongocryptdSpawnArgs": []string{"--port=23000", "--pidfilepath=TestCSOTClientSideEncryptionProse_1.pid"},
40-
"mongocryptdUri": "mongodb://localhost:23000",
45+
"mongocryptdURI": "mongodb://localhost:23000",
4146
// Do not use the shared library to ensure mongocryptd is spawned.
4247
"__cryptSharedLibDisabledForTestOnly": true,
4348
}
@@ -54,6 +59,11 @@ func TestCSOTClientSideEncryptionProse(t *testing.T) {
5459
assert.Nil(mt, err, "encrypted client Disconnect error: %v", err)
5560
}()
5661

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+
5767
// Use a new Client to connect to 23000 where mongocryptd should be running. Use a custom
5868
// command monitor to examine the eventual 'ping'.
5969
var started *event.CommandStartedEvent

0 commit comments

Comments
 (0)