diff options
Diffstat (limited to 'src/context/withtimeout_test.go')
| -rw-r--r-- | src/context/withtimeout_test.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/context/withtimeout_test.go b/src/context/withtimeout_test.go index 3ab6fc347f..2aea303bed 100644 --- a/src/context/withtimeout_test.go +++ b/src/context/withtimeout_test.go @@ -13,9 +13,9 @@ import ( func ExampleWithTimeout() { // Pass a context with a timeout to tell a blocking function that it // should abandon its work after the timeout elapses. - ctx, _ := context.WithTimeout(context.Background(), 100*time.Millisecond) + ctx, _ := context.WithTimeout(context.Background(), 50*time.Millisecond) select { - case <-time.After(200 * time.Millisecond): + case <-time.After(1 * time.Second): fmt.Println("overslept") case <-ctx.Done(): fmt.Println(ctx.Err()) // prints "context deadline exceeded" |
