From 1c40cffa7602c2384e6d347593dbb94cf9076f9d Mon Sep 17 00:00:00 2001 From: Fedor Korotkiy Date: Thu, 18 Mar 2021 18:04:38 +0300 Subject: [PATCH] Fix test --- dupcall/dupcall_test.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dupcall/dupcall_test.go b/dupcall/dupcall_test.go index 69fb771..bb9af2c 100644 --- a/dupcall/dupcall_test.go +++ b/dupcall/dupcall_test.go @@ -102,10 +102,13 @@ func TestCall_HalfCancel(t *testing.T) { func TestCall_FullCancel(t *testing.T) { defer goleak.VerifyNone(t) - cancelled := make(chan struct{}) + cancelled := make(chan struct{}, 1) cb := func(ctx context.Context) (interface{}, error) { <-ctx.Done() - close(cancelled) + select { + case cancelled <- struct{}{}: + default: + } return nil, nil }