util/gpool/spmc: make test case TestBenchPool stable (#42787)

close pingcap/tidb#42721
This commit is contained in:
tiancaiamao
2023-04-11 16:01:01 +08:00
committed by GitHub
parent 591849a8d3
commit 0a3169fbfe

View File

@ -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
}
}
}