Skip to content

Commit 81b76f7

Browse files
committed
lint
1 parent 289048d commit 81b76f7

3 files changed

Lines changed: 10 additions & 6 deletions

File tree

metrics/multinode_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ func TestMultiNodeMetrics_RecordNodeClientVersion(t *testing.T) {
4141
"rpc-1.2.3",
4242
))
4343

44-
require.Equal(t, float64(1), value)
44+
require.InEpsilon(t,
45+
1.0,
46+
value,
47+
0.001,
48+
)
4549
}
4650

4751
func TestMultiNodeMetrics_Verifies(t *testing.T) {

multinode/node_lifecycle.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,15 @@ func (n *node[CHAIN_ID, HEAD, RPC]) aliveLoop() {
110110
n.metrics.IncrementPolls(ctx, n.name)
111111
lggr.Tracew("Pinging RPC", "nodeState", n.State(), "pollFailures", pollFailures)
112112
pollCtx, cancel := context.WithTimeout(ctx, pollInterval)
113-
version, err := n.RPC().PingClientVersion(pollCtx)
113+
version, pingErr := n.RPC().PingClientVersion(pollCtx)
114114
cancel()
115-
if err != nil {
115+
if pingErr != nil {
116116
// prevent overflow
117117
if pollFailures < math.MaxUint32 {
118118
n.metrics.IncrementPollsFailed(ctx, n.name)
119119
pollFailures++
120120
}
121-
lggr.Warnw(fmt.Sprintf("Poll failure, RPC endpoint %s failed to respond properly", n.String()), "err", err, "pollFailures", pollFailures, "nodeState", n.getCachedState())
121+
lggr.Warnw(fmt.Sprintf("Poll failure, RPC endpoint %s failed to respond properly", n.String()), "err", pingErr, "pollFailures", pollFailures, "nodeState", n.getCachedState())
122122
} else {
123123
lggr.Debugw("Ping successful", "nodeState", n.State())
124124
n.metrics.RecordNodeClientVersion(ctx, n.name, version)

multinode/node_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
package multinode
22

33
import (
4-
"github.com/smartcontractkit/chainlink-framework/metrics"
5-
"github.com/stretchr/testify/require"
64
"net/url"
75
"testing"
86
"time"
97

108
"github.com/stretchr/testify/mock"
9+
"github.com/stretchr/testify/require"
1110

1211
"github.com/smartcontractkit/chainlink-common/pkg/logger"
1312

13+
"github.com/smartcontractkit/chainlink-framework/metrics"
1414
"github.com/smartcontractkit/chainlink-framework/multinode/mocks"
1515
)
1616

0 commit comments

Comments
 (0)