From eee32bdc25c4eca469dd001809f90db6557c5f81 Mon Sep 17 00:00:00 2001 From: tycho garen Date: Mon, 7 Mar 2022 17:00:59 -0500 Subject: [PATCH] fix --- internal/statesync/reactor_test.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/internal/statesync/reactor_test.go b/internal/statesync/reactor_test.go index fe92174e7..c1ac1a048 100644 --- a/internal/statesync/reactor_test.go +++ b/internal/statesync/reactor_test.go @@ -795,13 +795,11 @@ func handleConsensusParamsRequest( case <-ctx.Done(): return case envelope := <-receiving: - if ctx.Err() != nil { + msg, ok := envelope.Message.(*ssproto.ParamsRequest) + if !ok { + t.Errorf("message was %T which is not a params request", envelope.Message) return } - - t.Log("received consensus params request") - msg, ok := envelope.Message.(*ssproto.ParamsRequest) - require.True(t, ok) select { case sending <- p2p.Envelope{ From: envelope.To, @@ -811,6 +809,7 @@ func handleConsensusParamsRequest( }, }: case <-ctx.Done(): + return case <-closeCh: return }