From 2f1e08e948cf2f6be722ada37963b17f25744654 Mon Sep 17 00:00:00 2001 From: Sam Kleinman Date: Mon, 31 Jan 2022 10:04:56 -0500 Subject: [PATCH] conensus: put timeouts on reactor tests (#7733) --- internal/consensus/reactor_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/consensus/reactor_test.go b/internal/consensus/reactor_test.go index c0a6445aa..3e1c930d9 100644 --- a/internal/consensus/reactor_test.go +++ b/internal/consensus/reactor_test.go @@ -318,7 +318,7 @@ func ensureBlockSyncStatus(t *testing.T, msg tmpubsub.Message, complete bool, he } func TestReactorBasic(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() cfg := configSetup(t) @@ -371,7 +371,7 @@ func TestReactorBasic(t *testing.T) { } func TestReactorWithEvidence(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() cfg := configSetup(t) @@ -479,7 +479,7 @@ func TestReactorWithEvidence(t *testing.T) { } func TestReactorCreatesBlockWhenEmptyBlocksFalse(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() cfg := configSetup(t) @@ -535,7 +535,7 @@ func TestReactorCreatesBlockWhenEmptyBlocksFalse(t *testing.T) { } func TestReactorRecordsVotesAndBlockParts(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() cfg := configSetup(t) @@ -600,7 +600,7 @@ func TestReactorRecordsVotesAndBlockParts(t *testing.T) { } func TestReactorVotingPowerChange(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() cfg := configSetup(t) @@ -707,7 +707,7 @@ func TestReactorVotingPowerChange(t *testing.T) { } func TestReactorValidatorSetChanges(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() cfg := configSetup(t)