Fix test
This commit is contained in:
parent
b06113e223
commit
1c40cffa76
1 changed files with 5 additions and 2 deletions
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue