Skip to content

Commit 955283f

Browse files
committed
cleanup and comments
1 parent 163ff57 commit 955283f

File tree

1 file changed

+7
-16
lines changed

1 file changed

+7
-16
lines changed

internal/internal_event_handlers_test.go

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,6 @@ func TestWorkflowExecutionEventHandler_ProcessEvent_no_error_events(t *testing.T
490490
for _, tc := range []struct {
491491
event *s.HistoryEvent
492492
prepareHandler func(*testing.T, *workflowExecutionEventHandlerImpl)
493-
assertHandler func(*testing.T, *workflowExecutionEventHandlerImpl)
494493
}{
495494
{
496495
event: &s.HistoryEvent{
@@ -515,9 +514,6 @@ func TestWorkflowExecutionEventHandler_ProcessEvent_no_error_events(t *testing.T
515514
})
516515
impl.decisionsHelper.getDecisions(true)
517516
impl.decisionsHelper.handleActivityTaskScheduled(1, "test-activity")
518-
impl.completeHandler = func(result []byte, err error) {
519-
assert.NoError(t, err)
520-
}
521517
},
522518
},
523519
{
@@ -543,9 +539,6 @@ func TestWorkflowExecutionEventHandler_ProcessEvent_no_error_events(t *testing.T
543539
})
544540
impl.decisionsHelper.getDecisions(true)
545541
impl.decisionsHelper.handleActivityTaskScheduled(2, "test-activity")
546-
impl.completeHandler = func(result []byte, err error) {
547-
assert.NoError(t, err)
548-
}
549542
},
550543
},
551544
{
@@ -572,9 +565,6 @@ func TestWorkflowExecutionEventHandler_ProcessEvent_no_error_events(t *testing.T
572565
impl.decisionsHelper.handleActivityTaskScheduled(3, "test-activity")
573566
decision.cancel()
574567
decision.handleDecisionSent()
575-
impl.completeHandler = func(result []byte, err error) {
576-
assert.NoError(t, err)
577-
}
578568
},
579569
},
580570
{
@@ -600,9 +590,6 @@ func TestWorkflowExecutionEventHandler_ProcessEvent_no_error_events(t *testing.T
600590
impl.decisionsHelper.handleTimerStarted("test-timer")
601591
decision.cancel()
602592
decision.handleDecisionSent()
603-
impl.completeHandler = func(result []byte, err error) {
604-
assert.NoError(t, err)
605-
}
606593
},
607594
},
608595
{
@@ -629,9 +616,6 @@ func TestWorkflowExecutionEventHandler_ProcessEvent_no_error_events(t *testing.T
629616
impl.decisionsHelper.handleTimerStarted("test-timer")
630617
decision.cancel()
631618
decision.handleDecisionSent()
632-
impl.completeHandler = func(result []byte, err error) {
633-
assert.NoError(t, err)
634-
}
635619
},
636620
},
637621
{
@@ -698,6 +682,13 @@ func TestWorkflowExecutionEventHandler_ProcessEvent_no_error_events(t *testing.T
698682
tc.prepareHandler(t, weh)
699683
}
700684

685+
// EventHandle handles all internal failures as panics.
686+
// make sure we don't fail event processing.
687+
// This can happen if there is a panic inside the handler.
688+
weh.completeHandler = func(result []byte, err error) {
689+
assert.NoError(t, err)
690+
}
691+
701692
err := weh.ProcessEvent(tc.event, false, false)
702693
assert.NoError(t, err)
703694
})

0 commit comments

Comments
 (0)