This commit is contained in:
Fedor Korotkiy 2021-03-18 18:04:38 +03:00
parent b06113e223
commit 1c40cffa76

View file

@ -102,10 +102,13 @@ func TestCall_HalfCancel(t *testing.T) {
func TestCall_FullCancel(t *testing.T) { func TestCall_FullCancel(t *testing.T) {
defer goleak.VerifyNone(t) defer goleak.VerifyNone(t)
cancelled := make(chan struct{}) cancelled := make(chan struct{}, 1)
cb := func(ctx context.Context) (interface{}, error) { cb := func(ctx context.Context) (interface{}, error) {
<-ctx.Done() <-ctx.Done()
close(cancelled) select {
case cancelled <- struct{}{}:
default:
}
return nil, nil return nil, nil
} }