From ffaa123cb658c6d2c2c6b340df516268eff2c755 Mon Sep 17 00:00:00 2001 From: Brandon Weng <18161326+BrandonWeng@users.noreply.github.com> Date: Fri, 7 Apr 2023 12:49:29 -0400 Subject: [PATCH 1/5] Add metrics label for missing val power --- internal/consensus/metrics.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/consensus/metrics.go b/internal/consensus/metrics.go index ea11b4cf1..45f673535 100644 --- a/internal/consensus/metrics.go +++ b/internal/consensus/metrics.go @@ -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. From ea637285476619d6238e5b306f8ac04ef20cdd20 Mon Sep 17 00:00:00 2001 From: Brandon Weng <18161326+BrandonWeng@users.noreply.github.com> Date: Fri, 7 Apr 2023 12:49:47 -0400 Subject: [PATCH 2/5] Make metrics --- internal/consensus/metrics.gen.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/consensus/metrics.gen.go b/internal/consensus/metrics.gen.go index cd2b1b534..30c35f430 100644 --- a/internal/consensus/metrics.gen.go +++ b/internal/consensus/metrics.gen.go @@ -75,7 +75,7 @@ func PrometheusMetrics(namespace string, labelsAndValues ...string) *Metrics { Subsystem: MetricsSubsystem, Name: "missing_validators_power", Help: "Total power of the missing validators.", - }, labels).With(labelsAndValues...), + }, append(labels, "validator_address")).With(labelsAndValues...), ByzantineValidators: prometheus.NewGaugeFrom(stdprometheus.GaugeOpts{ Namespace: namespace, Subsystem: MetricsSubsystem, From 1f68e8ef52630ded7062eaf68073a7545769840a Mon Sep 17 00:00:00 2001 From: Brandon Weng <18161326+BrandonWeng@users.noreply.github.com> Date: Fri, 7 Apr 2023 13:29:00 -0400 Subject: [PATCH 3/5] Fix timeout --- internal/consensus/reactor_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/consensus/reactor_test.go b/internal/consensus/reactor_test.go index 8f9daf6a8..24dc88c00 100644 --- a/internal/consensus/reactor_test.go +++ b/internal/consensus/reactor_test.go @@ -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(), 5 * time.Minute) defer cancel() cfg := configSetup(t) From 515b14651d7b863502a32575872ba21436496933 Mon Sep 17 00:00:00 2001 From: Brandon Weng <18161326+BrandonWeng@users.noreply.github.com> Date: Fri, 7 Apr 2023 13:42:32 -0400 Subject: [PATCH 4/5] Time out --- internal/consensus/reactor_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/consensus/reactor_test.go b/internal/consensus/reactor_test.go index 24dc88c00..58ea74746 100644 --- a/internal/consensus/reactor_test.go +++ b/internal/consensus/reactor_test.go @@ -772,7 +772,7 @@ func TestReactorRecordsVotesAndBlockParts(t *testing.T) { } func TestReactorVotingPowerChange(t *testing.T) { - ctx, cancel := context.WithTimeout(context.Background(), 5 * time.Minute) + ctx, cancel := context.WithTimeout(context.Background(), 2 * time.Minute) defer cancel() cfg := configSetup(t) From 4bed39adab9d713bdb190475fde47146bed5b1c4 Mon Sep 17 00:00:00 2001 From: Brandon Weng <18161326+BrandonWeng@users.noreply.github.com> Date: Fri, 7 Apr 2023 13:49:50 -0400 Subject: [PATCH 5/5] More timout --- internal/p2p/p2ptest/network.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/p2p/p2ptest/network.go b/internal/p2p/p2ptest/network.go index e0543548e..786e6cb68 100644 --- a/internal/p2p/p2ptest/network.go +++ b/internal/p2p/p2ptest/network.go @@ -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) } @@ -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) } @@ -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 }