File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -196,28 +196,3 @@ func TestPool_Metrics(t *testing.T) {
196196 assert .Equal (t , uint64 (2 ), snap .TasksDropped )
197197}
198198
199- func TestPool_SubmitRecoverPanic (t * testing.T ) {
200- t .Run ("recover from closed channel" , func (t * testing.T ) {
201- wp , _ := NewPool (& Config {Executor : & poolTestExecutor {}})
202- pool := wp .(* workerPool )
203-
204- // close the buffer to trigger panic on send
205- close (pool .workerTaskBuffer )
206-
207- err := wp .Submit (context .Background (), & core.Request {}, "cb" , nil )
208- assert .Error (t , err )
209- assert .Equal (t , ErrPoolClosed , err )
210- })
211-
212- t .Run ("do not recover from other panics" , func (t * testing.T ) {
213- wp , _ := NewPool (& Config {Executor : & poolTestExecutor {}})
214- pool := wp .(* workerPool )
215-
216- // set autoscaler to nil to trigger nil pointer panic in Submit
217- pool .autoscaler = nil
218-
219- assert .Panics (t , func () {
220- _ = wp .Submit (context .Background (), & core.Request {}, "cb" , nil )
221- })
222- })
223- }
You can’t perform that action at this time.
0 commit comments