File tree Expand file tree Collapse file tree 2 files changed +5
-8
lines changed
Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -2,24 +2,23 @@ package buzz
22
33import (
44 "context"
5- "errors"
65 "testing"
76)
87
98func TestRecoveryMiddleware (t * testing.T ) {
10- bee := NewWorker (& mockTask {
9+ worker := NewWorker (& mockTask {
1110 dofunc : func (ctx context.Context ) error {
12- return errors . New ("darn" )
11+ panic ("darn" )
1312 },
1413 }).Use (RecoveryMiddleware )
15- chain := bee .assembleCallChain ()
14+ chain := worker .assembleCallChain ()
1615 if chain .exec == nil {
1716 t .Fatal ("exec was supposed to be defined but was nil instead" )
1817 }
1918 if chain .next == nil {
2019 t .Fatal ("chain.next was not supposed to be nil" )
2120 }
22- if err := bee .runChainOnce (context .Background (), chain ); err == nil {
21+ if err := worker .runChainOnce (context .Background (), chain ); err == nil {
2322 t .Fatal ("runChainOnce was supposed to return an error but did not" )
2423 }
2524}
Original file line number Diff line number Diff line change @@ -65,9 +65,7 @@ func (w *Worker) run(block *sync.WaitGroup) {
6565 case <- ctx .Done ():
6666 return
6767 default :
68- if err := w .runChainOnce (ctx , callChain ); err != nil {
69- return
70- }
68+ _ = w .runChainOnce (ctx , callChain )
7169 }
7270 }
7371}
You can’t perform that action at this time.
0 commit comments