From e18e2c80544fb355d4f483182c5e89ef9061984e Mon Sep 17 00:00:00 2001 From: iamqizhao Date: Wed, 21 Oct 2015 15:21:58 -0700 Subject: [PATCH 1/2] fix a bug in test --- test/end2end_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/end2end_test.go b/test/end2end_test.go index d47af7ed..644c3857 100644 --- a/test/end2end_test.go +++ b/test/end2end_test.go @@ -1063,11 +1063,12 @@ func testExceedMaxStreamsLimit(t *testing.T, e env) { done := make(chan struct{}) ch := make(chan int) go func() { + timer := time.After(5 * time.Second) for { select { case <-time.After(5 * time.Millisecond): ch <- 0 - case <-time.After(5 * time.Second): + case <-timer: close(done) return } @@ -1077,6 +1078,7 @@ func testExceedMaxStreamsLimit(t *testing.T, e env) { for { select { case <-ch: + //grpclog.Println("start a stream...") ctx, _ := context.WithTimeout(context.Background(), time.Second) if _, err := tc.StreamingInputCall(ctx); err != nil { if grpc.Code(err) == codes.DeadlineExceeded { From 17b181003d396bb76a86dd4a210a86ad28c1f8b4 Mon Sep 17 00:00:00 2001 From: iamqizhao Date: Wed, 21 Oct 2015 15:24:16 -0700 Subject: [PATCH 2/2] remove debug info --- test/end2end_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/test/end2end_test.go b/test/end2end_test.go index 644c3857..862261ef 100644 --- a/test/end2end_test.go +++ b/test/end2end_test.go @@ -1078,7 +1078,6 @@ func testExceedMaxStreamsLimit(t *testing.T, e env) { for { select { case <-ch: - //grpclog.Println("start a stream...") ctx, _ := context.WithTimeout(context.Background(), time.Second) if _, err := tc.StreamingInputCall(ctx); err != nil { if grpc.Code(err) == codes.DeadlineExceeded {