File tree Expand file tree Collapse file tree 4 files changed +9
-2
lines changed Expand file tree Collapse file tree 4 files changed +9
-2
lines changed File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ import (
23
23
"github.com/mongodb/mongo-go-driver/x/bsonx"
24
24
"github.com/stretchr/testify/require"
25
25
26
+ "github.com/mongodb/mongo-go-driver/internal/testutil/israce"
26
27
"golang.org/x/net/context"
27
28
)
28
29
@@ -199,7 +200,13 @@ func TestGridFS(t *testing.T) {
199
200
if err != nil {
200
201
t .Fatalf ("Failed to create bucket: %v" , err )
201
202
}
202
- err = bucket .SetWriteDeadline (time .Now ().Add (5 * time .Second ))
203
+
204
+ timeout := 5 * time .Second
205
+ if israce .Enabled {
206
+ timeout = 20 * time .Second // race detector causes 2-20x slowdown
207
+ }
208
+
209
+ err = bucket .SetWriteDeadline (time .Now ().Add (timeout ))
203
210
if err != nil {
204
211
t .Fatalf ("Failed to set write deadline: %v" , err )
205
212
}
Original file line number Diff line number Diff line change @@ -17,13 +17,13 @@ import (
17
17
18
18
"github.com/mongodb/mongo-go-driver/bson"
19
19
"github.com/mongodb/mongo-go-driver/internal/testutil"
20
+ "github.com/mongodb/mongo-go-driver/internal/testutil/israce"
20
21
"github.com/mongodb/mongo-go-driver/mongo/writeconcern"
21
22
"github.com/mongodb/mongo-go-driver/x/bsonx"
22
23
"github.com/mongodb/mongo-go-driver/x/mongo/driver/topology"
23
24
"github.com/mongodb/mongo-go-driver/x/network/address"
24
25
"github.com/mongodb/mongo-go-driver/x/network/command"
25
26
"github.com/mongodb/mongo-go-driver/x/network/description"
26
- "github.com/mongodb/mongo-go-driver/x/network/integration/internal/israce"
27
27
"github.com/stretchr/testify/assert"
28
28
)
29
29
You can’t perform that action at this time.
0 commit comments