File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -316,7 +316,7 @@ func TestQueryContext(t *testing.T) {
316
316
select {
317
317
case <- ctx .Done ():
318
318
if err := ctx .Err (); err != context .Canceled {
319
- t .Fatalf ("context err = %v; want context.Canceled" )
319
+ t .Fatalf ("context err = %v; want context.Canceled" , err )
320
320
}
321
321
default :
322
322
t .Fatalf ("context err = nil; want context.Canceled" )
@@ -365,7 +365,8 @@ func TestQueryContextWait(t *testing.T) {
365
365
defer closeDB (t , db )
366
366
prepares0 := numPrepares (t , db )
367
367
368
- ctx , _ := context .WithTimeout (context .Background (), time .Millisecond * 15 )
368
+ ctx , cancel := context .WithTimeout (context .Background (), time .Millisecond * 15 )
369
+ defer cancel ()
369
370
370
371
// This will trigger the *fakeConn.Prepare method which will take time
371
372
// performing the query. The ctxDriverPrepare func will check the context
@@ -386,7 +387,8 @@ func TestTxContextWait(t *testing.T) {
386
387
db := newTestDB (t , "people" )
387
388
defer closeDB (t , db )
388
389
389
- ctx , _ := context .WithTimeout (context .Background (), time .Millisecond * 15 )
390
+ ctx , cancel := context .WithTimeout (context .Background (), time .Millisecond * 15 )
391
+ defer cancel ()
390
392
391
393
tx , err := db .BeginTx (ctx , nil )
392
394
if err != nil {
You can’t perform that action at this time.
0 commit comments