diff --git a/src/database/sql/sql_test.go b/src/database/sql/sql_test.go index 80f63e877d0024..7d1cb9b85a59bf 100644 --- a/src/database/sql/sql_test.go +++ b/src/database/sql/sql_test.go @@ -2838,9 +2838,10 @@ func TestTxStmtDeadlock(t *testing.T) { db := newTestDB(t, "people") defer closeDB(t, db) - ctx, cancel := context.WithTimeout(context.Background(), 5*time.Millisecond) + ctx, cancel := context.WithCancel(context.Background()) defer cancel() tx, err := db.BeginTx(ctx, nil) + cancel() if err != nil { t.Fatal(err) }