diff --git a/pkg/heartbeat/service_test.go b/pkg/heartbeat/service_test.go index d7aed15..a2b59e3 100644 --- a/pkg/heartbeat/service_test.go +++ b/pkg/heartbeat/service_test.go @@ -17,7 +17,7 @@ func TestExecuteHeartbeat_Async(t *testing.T) { defer os.RemoveAll(tmpDir) hs := NewHeartbeatService(tmpDir, 30, true) - hs.started = true // Enable for testing + hs.stopChan = make(chan struct{}) // Enable for testing asyncCalled := false asyncResult := &tools.ToolResult{ @@ -55,7 +55,7 @@ func TestExecuteHeartbeat_Error(t *testing.T) { defer os.RemoveAll(tmpDir) hs := NewHeartbeatService(tmpDir, 30, true) - hs.started = true // Enable for testing + hs.stopChan = make(chan struct{}) // Enable for testing hs.SetHandler(func(prompt, channel, chatID string) *tools.ToolResult { return &tools.ToolResult{ @@ -93,7 +93,7 @@ func TestExecuteHeartbeat_Silent(t *testing.T) { defer os.RemoveAll(tmpDir) hs := NewHeartbeatService(tmpDir, 30, true) - hs.started = true // Enable for testing + hs.stopChan = make(chan struct{}) // Enable for testing hs.SetHandler(func(prompt, channel, chatID string) *tools.ToolResult { return &tools.ToolResult{ @@ -167,7 +167,7 @@ func TestExecuteHeartbeat_NilResult(t *testing.T) { defer os.RemoveAll(tmpDir) hs := NewHeartbeatService(tmpDir, 30, true) - hs.started = true // Enable for testing + hs.stopChan = make(chan struct{}) // Enable for testing hs.SetHandler(func(prompt, channel, chatID string) *tools.ToolResult { return nil