Skip to content

Commit

Permalink
[-] updated test to cover non error panic
Browse files Browse the repository at this point in the history
  • Loading branch information
bnkamalesh committed Nov 4, 2024
1 parent 3d12e10 commit a33d970
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions nibbler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func TestProcessorErr(tt *testing.T) {
receiver <- "again"
})

tt.Run("panic recovery with resume", func(t *testing.T) {
tt.Run("panic recovery with resume and non error panic", func(t *testing.T) {
receivedErr := make(chan bool, 2)
asserter := assert.New(t)

Expand All @@ -193,10 +193,10 @@ func TestProcessorErr(tt *testing.T) {
nib, err := Start(&Config[string]{
TickerDuration: time.Second,
Processor: func(_ context.Context, _ trigger, _ []string) error {
panic(errProcessing)
panic("processor panic")
},
ProcessorErr: func(failedBatch []string, err error) {
asserter.ErrorIs(err, errProcessing, "panic recovery with resume")
asserter.ErrorContains(err, "processor panic")
asserter.ElementsMatch([]string{assertElement}, failedBatch, "panic recovery with resume")
receivedErr <- true
},
Expand Down

0 comments on commit a33d970

Please sign in to comment.