File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -112,9 +112,24 @@ func TestGridFS(t *testing.T) {
112112}
113113
114114func 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 () {
You can’t perform that action at this time.
0 commit comments