From 2a92d3c96e480986ae40fd49e8ac7d97fc80c927 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Tue, 1 Mar 2016 13:57:24 +0200 Subject: [PATCH] Reduced concurrency and increased wait time in TestPipeConnsCloseWhileReadWriteConcurrent, so it may pass on slow CPUs and/or with -race flag --- fasthttputil/pipeconns_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fasthttputil/pipeconns_test.go b/fasthttputil/pipeconns_test.go index daa7a4b..3df5d35 100644 --- a/fasthttputil/pipeconns_test.go +++ b/fasthttputil/pipeconns_test.go @@ -10,7 +10,7 @@ import ( ) func TestPipeConnsCloseWhileReadWriteConcurrent(t *testing.T) { - concurrency := 10 + concurrency := 4 ch := make(chan struct{}, concurrency) for i := 0; i < concurrency; i++ { go func() { @@ -22,7 +22,7 @@ func TestPipeConnsCloseWhileReadWriteConcurrent(t *testing.T) { for i := 0; i < concurrency; i++ { select { case <-ch: - case <-time.After(time.Second): + case <-time.After(3*time.Second): t.Fatalf("timeout") } }