Skip to content

Commit

Permalink
add a comment on heartbeater test logic
Browse files Browse the repository at this point in the history
  • Loading branch information
3vilhamster committed Nov 1, 2024
1 parent 4fc4804 commit 717cac9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/auto_heartbeater_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ func TestAutoHearbeater_Run(t *testing.T) {
}
)

// Run is a sync function that is spawned in a goroutine normally.
// So instead of asserting the results we can verify that the function exists.

t.Run("worker stop channel", func(t *testing.T) {
stopCh := make(chan struct{})
invoker := &MockServiceInvoker{}
Expand All @@ -53,7 +56,7 @@ func TestAutoHearbeater_Run(t *testing.T) {
hearbeater := newHeartbeater(stopCh, invoker, logger, clock, activityType, workflowExecution)

close(stopCh)

hearbeater.Run(context.Background(), time.Second)
})
t.Run("context done", func(t *testing.T) {
Expand Down

0 comments on commit 717cac9

Please sign in to comment.