util/gpool/spmc: make test case TestBenchPool stable (#42787)
close pingcap/tidb#42721
This commit is contained in:
@ -453,12 +453,8 @@ func TestBenchPool(t *testing.T) {
|
||||
select {
|
||||
case <-sema:
|
||||
return struct{}{}, nil
|
||||
default:
|
||||
select {
|
||||
case <-exitCh:
|
||||
return struct{}{}, gpool.ErrProducerClosed
|
||||
default:
|
||||
}
|
||||
case <-exitCh:
|
||||
return struct{}{}, gpool.ErrProducerClosed
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user