mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
+4
-3
@@ -3,10 +3,11 @@ package testutil
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func Context(t *testing.T) (context.Context, context.CancelFunc) {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), WaitLong)
|
||||
func Context(t *testing.T, dur time.Duration) context.Context {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), dur)
|
||||
t.Cleanup(cancel)
|
||||
return ctx, cancel
|
||||
return ctx
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user