Skip to content

Commit

Permalink
Add metrics label for missing val power (#113)
Browse files Browse the repository at this point in the history
* Add metrics label for missing val power

* Make metrics

* Fix timeout

* Time out

* More timout
  • Loading branch information
BrandonWeng authored Apr 7, 2023
1 parent 1e67899 commit 7c2f07e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion internal/consensus/metrics.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/consensus/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ type Metrics struct {
// Number of validators who did not sign.
MissingValidators metrics.Gauge
// Total power of the missing validators.
MissingValidatorsPower metrics.Gauge
MissingValidatorsPower metrics.Gauge `metrics_labels:"validator_address"`
// Number of validators who tried to double sign.
ByzantineValidators metrics.Gauge
// Total power of the byzantine validators.
Expand Down
2 changes: 1 addition & 1 deletion internal/consensus/reactor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ func TestReactorRecordsVotesAndBlockParts(t *testing.T) {
}

func TestReactorVotingPowerChange(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
ctx, cancel := context.WithTimeout(context.Background(), 2 * time.Minute)
defer cancel()

cfg := configSetup(t)
Expand Down
6 changes: 3 additions & 3 deletions internal/p2p/p2ptest/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func (n *Network) Start(ctx context.Context, t *testing.T) {
case peerUpdate := <-sourceSub.Updates():
require.Equal(t, targetNode.NodeID, peerUpdate.NodeID)
require.Equal(t, p2p.PeerStatusUp, peerUpdate.Status)
case <-time.After(3 * time.Second):
case <-time.After(30 * time.Second):
require.Fail(t, "timed out waiting for peer", "%v dialing %v",
sourceNode.NodeID, targetNode.NodeID)
}
Expand All @@ -118,7 +118,7 @@ func (n *Network) Start(ctx context.Context, t *testing.T) {
NodeID: sourceNode.NodeID,
Status: p2p.PeerStatusUp,
}, peerUpdate)
case <-time.After(3 * time.Second):
case <-time.After(30 * time.Second):
require.Fail(t, "timed out waiting for peer", "%v accepting %v",
targetNode.NodeID, sourceNode.NodeID)
}
Expand Down Expand Up @@ -252,7 +252,7 @@ func (n *Network) MakeNode(ctx context.Context, t *testing.T, opts NodeOptions)
require.NoError(t, err)
require.NotNil(t, ep, "transport not listening an endpoint")

maxRetryTime := 500 * time.Millisecond
maxRetryTime := 1000 * time.Millisecond
if opts.MaxRetryTime > 0 {
maxRetryTime = opts.MaxRetryTime
}
Expand Down

0 comments on commit 7c2f07e

Please sign in to comment.