From 4ed24a5656e8662106b892dc38f262290788134c Mon Sep 17 00:00:00 2001 From: William Banfield Date: Fri, 15 Oct 2021 16:34:58 -0400 Subject: [PATCH] fix tests to ensure we are before timeout precommit step --- internal/consensus/state_test.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/internal/consensus/state_test.go b/internal/consensus/state_test.go index a1db8276d..87bb0931c 100644 --- a/internal/consensus/state_test.go +++ b/internal/consensus/state_test.go @@ -1639,13 +1639,14 @@ func TestStartNextHeightCorrectlyAfterTimeout(t *testing.T) { ensureNewTimeout(timeoutProposeCh, height+1, round, cs1.config.Propose(round).Nanoseconds()) rs = cs1.GetRoundState() - assert.False( + assert.Less( t, - rs.TriggeredTimeoutPrecommit, - "triggeredTimeoutPrecommit should be false at the beginning of each round") + rs.Step, + cstypes.RoundStepPrecommitWait, + "RoundStep should be less than 'PrecommitWait' at the beginning of each round") } -func TestResetTimeoutPrecommitUponNewHeight(t *testing.T) { +func TestNotEnteredTimeoutPrecommitUponNewHeight(t *testing.T) { config := configSetup(t) config.Consensus.SkipTimeoutCommit = false @@ -1698,10 +1699,11 @@ func TestResetTimeoutPrecommitUponNewHeight(t *testing.T) { ensureNewProposal(proposalCh, height+1, 0) rs = cs1.GetRoundState() - assert.False( + assert.Less( t, - rs.TriggeredTimeoutPrecommit, - "triggeredTimeoutPrecommit should be false at the beginning of each height") + rs.Step, + cstypes.RoundStepPrecommitWait, + "RoundStep should be less than 'PrecommitWait' at the beginning of each round") } //------------------------------------------------------------------------------------------