Skip to content

Commit

Permalink
Disable daemon health check panic (#534)
Browse files Browse the repository at this point in the history
* Disable daemon health check panic

* disable test
  • Loading branch information
jayy04 authored Oct 7, 2023
1 parent e80e8bd commit 10b4a67
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion protocol/daemons/server/types/update_monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func (ufm *UpdateMonitor) RegisterDaemonServiceWithCallback(
// service is not responding. This is ideal for creating the callback function when registering a daemon service.
func PanicServiceNotResponding(service string) func() {
return func() {
panic(fmt.Sprintf("%v daemon not responding", service))
// panic(fmt.Sprintf("%v daemon not responding", service))
}
}

Expand Down
11 changes: 6 additions & 5 deletions protocol/daemons/server/types/update_monitor_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package types

import (
"github.com/stretchr/testify/require"
"sync/atomic"
"testing"
"time"

"github.com/stretchr/testify/require"
)

// The following tests may still intermittently fail on an overloaded system as they rely
Expand Down Expand Up @@ -140,7 +141,7 @@ func TestRegisterValidResponseWithCallback_NegativeUpdateDelay(t *testing.T) {
require.ErrorContains(t, err, "update delay -50ms must be positive")
}

func TestPanicServiceNotResponding(t *testing.T) {
panicFunc := PanicServiceNotResponding("test-service")
require.Panics(t, panicFunc)
}
// func TestPanicServiceNotResponding(t *testing.T) {
// panicFunc := PanicServiceNotResponding("test-service")
// require.Panics(t, panicFunc)
// }

0 comments on commit 10b4a67

Please sign in to comment.