Skip to content

Commit a58f91a

Browse files
GODRIVER-3565 More test fixes
1 parent 77b5c78 commit a58f91a

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

mongo/gridfs_test.go

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,24 @@ func TestGridFS(t *testing.T) {
112112
}
113113

114114
func TestGridFSFile_UnmarshalBSON(t *testing.T) {
115+
if testing.Short() {
116+
t.Skip("skipping integration test in short mode")
117+
}
118+
115119
cs := integtest.ConnString(t)
116120

117-
client, err := Connect(options.Client().ApplyURI(cs.Original))
121+
clientOpts := options.Client().
122+
ApplyURI(cs.Original).
123+
SetReadPreference(readpref.Primary()).
124+
SetWriteConcern(writeconcern.Majority()).
125+
// Connect to a single host. For sharded clusters, this will pin to a single mongos, which avoids
126+
// non-deterministic versioning errors in the server. This has no effect for replica sets because the driver
127+
// will discover the other hosts during SDAM checks.
128+
SetHosts(cs.Hosts[:1])
129+
130+
integtest.AddTestServerAPIVersion(clientOpts)
131+
132+
client, err := Connect(clientOpts)
118133
require.NoError(t, err)
119134

120135
defer func() {

0 commit comments

Comments
 (0)