diff --git a/example_test.go b/example_test.go index 1baaa11..e5cb5b2 100644 --- a/example_test.go +++ b/example_test.go @@ -254,9 +254,9 @@ func ExamplePubSub_Receive() { } fmt.Println(n, "clients received message") - for { + for i := 0; i < 2; i++ { // ReceiveTimeout is a low level API. Use ReceiveMessage instead. - msgi, err := pubsub.ReceiveTimeout(time.Second) + msgi, err := pubsub.ReceiveTimeout(5 * time.Second) if err != nil { break }