Skip to content

Commit

Permalink
driver: fix cancellation delay
Browse files Browse the repository at this point in the history
  • Loading branch information
julienschmidt committed May 29, 2018
1 parent e73ee35 commit 1379c75
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions driver_go18_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ func TestContextCancelExec(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())

// Delay execution for just a bit until db.ExecContext has begun.
defer time.AfterFunc(500*time.Millisecond, cancel).Stop()
defer time.AfterFunc(250*time.Millisecond, cancel).Stop()

// This query will be canceled.
startTime := time.Now()
Expand Down Expand Up @@ -294,7 +294,7 @@ func TestContextCancelQuery(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())

// Delay execution for just a bit until db.ExecContext has begun.
defer time.AfterFunc(500*time.Millisecond, cancel).Stop()
defer time.AfterFunc(250*time.Millisecond, cancel).Stop()

// This query will be canceled.
startTime := time.Now()
Expand Down Expand Up @@ -385,7 +385,7 @@ func TestContextCancelStmtExec(t *testing.T) {
}

// Delay execution for just a bit until db.ExecContext has begun.
defer time.AfterFunc(500*time.Millisecond, cancel).Stop()
defer time.AfterFunc(250*time.Millisecond, cancel).Stop()

// This query will be canceled.
startTime := time.Now()
Expand Down Expand Up @@ -420,7 +420,7 @@ func TestContextCancelStmtQuery(t *testing.T) {
}

// Delay execution for just a bit until db.ExecContext has begun.
defer time.AfterFunc(500*time.Millisecond, cancel).Stop()
defer time.AfterFunc(250*time.Millisecond, cancel).Stop()

// This query will be canceled.
startTime := time.Now()
Expand Down

0 comments on commit 1379c75

Please sign in to comment.