aboutsummaryrefslogtreecommitdiff
path: root/src/context/withtimeout_test.go
diff options
context:
space:
mode:
authorRick Hudson <rlh@golang.org>2016-04-27 18:19:16 -0400
committerRick Hudson <rlh@golang.org>2016-04-27 18:46:52 -0400
commit23aeb34df172b17b7bfaa85fb59ca64bef9073bb (patch)
treea8ab866f1e50f0059856ce628f036d93ab620155 /src/context/withtimeout_test.go
parent1354b32cd70f2702381764fd595dd2faa996840c (diff)
parentd3c79d324acd7300b6f705e66af8ca711af00d9f (diff)
downloadgo-23aeb34df172b17b7bfaa85fb59ca64bef9073bb.tar.xz
[dev.garbage] Merge remote-tracking branch 'origin/master' into HEAD
Change-Id: I282fd9ce9db435dfd35e882a9502ab1abc185297
Diffstat (limited to 'src/context/withtimeout_test.go')
-rw-r--r--src/context/withtimeout_test.go4
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"