Skip to content

Commit e498ea7

Browse files
Fix make errors for go version 1.11
Change-Id: I79592813884263721ee8c569a32207bbce6992c0
1 parent b4e3557 commit e498ea7

File tree

4 files changed

+32
-32
lines changed

4 files changed

+32
-32
lines changed

core/session/session_pool_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,20 @@ func TestSessionPool(t *testing.T) {
2020
p.timeout = 30 // Set to some arbitrarily high number greater than 1 minute.
2121

2222
first, err := p.GetSession()
23-
testhelpers.RequireNil(t, err, "error getting session", err)
23+
testhelpers.RequireNil(t, err, "error getting session %s", err)
2424
firstID := first.SessionID
2525

2626
second, err := p.GetSession()
27-
testhelpers.RequireNil(t, err, "error getting session", err)
27+
testhelpers.RequireNil(t, err, "error getting session %s", err)
2828
secondID := second.SessionID
2929

3030
p.ReturnSession(first)
3131
p.ReturnSession(second)
3232

3333
sess, err := p.GetSession()
34-
testhelpers.RequireNil(t, err, "error getting session", err)
34+
testhelpers.RequireNil(t, err, "error getting session %s", err)
3535
nextSess, err := p.GetSession()
36-
testhelpers.RequireNil(t, err, "error getting session", err)
36+
testhelpers.RequireNil(t, err, "error getting session %s", err)
3737

3838
if sess.SessionID != secondID {
3939
t.Errorf("first sesssion ID mismatch. got %s expected %s", sess.SessionID, secondID)
@@ -51,18 +51,18 @@ func TestSessionPool(t *testing.T) {
5151
p.timeout = 0
5252

5353
first, err := p.GetSession()
54-
testhelpers.RequireNil(t, err, "error getting session", err)
54+
testhelpers.RequireNil(t, err, "error getting session %s", err)
5555
firstID := first.SessionID
5656

5757
second, err := p.GetSession()
58-
testhelpers.RequireNil(t, err, "error getting session", err)
58+
testhelpers.RequireNil(t, err, "error getting session %s", err)
5959
secondID := second.SessionID
6060

6161
p.ReturnSession(first)
6262
p.ReturnSession(second)
6363

6464
sess, err := p.GetSession()
65-
testhelpers.RequireNil(t, err, "error getting session", err)
65+
testhelpers.RequireNil(t, err, "error getting session %s", err)
6666

6767
if sess.SessionID == firstID || sess.SessionID == secondID {
6868
t.Errorf("Expired sessions not removed!")

core/topology/topology_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ func TestSessionTimeout(t *testing.T) {
309309

310310
timeoutChan := time.After(testTimeout)
311311
topo.changes <- description.Server{
312-
Kind: description.RSPrimary,
312+
Kind: description.RSPrimary,
313313
SessionTimeoutMinutes: 30,
314314
}
315315
topo.done <- struct{}{}
@@ -338,12 +338,12 @@ func TestSessionTimeout(t *testing.T) {
338338

339339
timeoutChan := time.After(testTimeout)
340340
topo.changes <- description.Server{
341-
Kind: description.RSPrimary,
341+
Kind: description.RSPrimary,
342342
SessionTimeoutMinutes: 30,
343343
}
344344
// should update because new timeout is lower
345345
topo.changes <- description.Server{
346-
Kind: description.RSPrimary,
346+
Kind: description.RSPrimary,
347347
SessionTimeoutMinutes: 20,
348348
}
349349
topo.done <- struct{}{}
@@ -372,12 +372,12 @@ func TestSessionTimeout(t *testing.T) {
372372

373373
timeoutChan := time.After(testTimeout)
374374
topo.changes <- description.Server{
375-
Kind: description.RSPrimary,
375+
Kind: description.RSPrimary,
376376
SessionTimeoutMinutes: 20,
377377
}
378378
// should not update because new timeout is higher
379379
topo.changes <- description.Server{
380-
Kind: description.RSPrimary,
380+
Kind: description.RSPrimary,
381381
SessionTimeoutMinutes: 30,
382382
}
383383
topo.done <- struct{}{}
@@ -406,12 +406,12 @@ func TestSessionTimeout(t *testing.T) {
406406

407407
timeoutChan := time.After(testTimeout)
408408
topo.changes <- description.Server{
409-
Kind: description.RSPrimary,
409+
Kind: description.RSPrimary,
410410
SessionTimeoutMinutes: 20,
411411
}
412412
// should not update because not a data bearing server
413413
topo.changes <- description.Server{
414-
Kind: description.Unknown,
414+
Kind: description.Unknown,
415415
SessionTimeoutMinutes: 10,
416416
}
417417
topo.done <- struct{}{}

mongo/client_options_test.go

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -136,23 +136,23 @@ func TestClientOptions_chainAll(t *testing.T) {
136136
"mongodb://localhost:27018",
137137
"mongodb://localhost:27019",
138138
},
139-
LocalThresholdSet: true,
140-
LocalThreshold: time.Second,
141-
MaxConnIdleTime: 30 * time.Second,
142-
MaxConnIdleTimeSet: true,
143-
MaxConnsPerHost: 150,
144-
MaxConnsPerHostSet: true,
145-
MaxIdleConnsPerHost: 20,
146-
MaxIdleConnsPerHostSet: true,
147-
ReplicaSet: "foo",
148-
ServerSelectionTimeoutSet: true,
149-
ServerSelectionTimeout: time.Second,
150-
Connect: connstring.AutoConnect,
151-
ConnectSet: true,
152-
SocketTimeout: 2 * time.Second,
153-
SocketTimeoutSet: true,
154-
SSL: true,
155-
SSLSet: true,
139+
LocalThresholdSet: true,
140+
LocalThreshold: time.Second,
141+
MaxConnIdleTime: 30 * time.Second,
142+
MaxConnIdleTimeSet: true,
143+
MaxConnsPerHost: 150,
144+
MaxConnsPerHostSet: true,
145+
MaxIdleConnsPerHost: 20,
146+
MaxIdleConnsPerHostSet: true,
147+
ReplicaSet: "foo",
148+
ServerSelectionTimeoutSet: true,
149+
ServerSelectionTimeout: time.Second,
150+
Connect: connstring.AutoConnect,
151+
ConnectSet: true,
152+
SocketTimeout: 2 * time.Second,
153+
SocketTimeoutSet: true,
154+
SSL: true,
155+
SSLSet: true,
156156
SSLClientCertificateKeyFile: "client.pem",
157157
SSLClientCertificateKeyFileSet: true,
158158
SSLClientCertificateKeyPassword: nil,

mongo/command_monitoring_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ func runCmTestFile(t *testing.T, filepath string) {
167167

168168
coll := db.Collection(collName)
169169
err = insertDocuments(doc.Lookup("data").MutableArray(), coll)
170-
testhelpers.RequireNil(t, err, "error inserting starting data: %s")
170+
testhelpers.RequireNil(t, err, "error inserting starting data: %s", err)
171171

172172
operationDoc := testDoc.Lookup("operation").MutableDocument()
173173

0 commit comments

Comments
 (0)