diff --git a/test/e2e/tests/validator_test.go b/test/e2e/tests/validator_test.go index f358296f2..247f2c586 100644 --- a/test/e2e/tests/validator_test.go +++ b/test/e2e/tests/validator_test.go @@ -77,8 +77,12 @@ func TestValidator_Propose(t *testing.T) { require.False(t, proposeCount == 0 && expectCount > 0, "node did not propose any blocks (expected %v)", expectCount) - require.Less(t, expectCount-proposeCount, 5, - "validator missed proposing too many blocks (proposed %v out of %v)", proposeCount, expectCount) + if expectCount > 3 { + require.GreaterOrEqual(t, proposeCount, 3, "validator didn't propose even 3 blocks") + } else { + require.Equal(t, proposeCount, expectCount, "validator missed proposing blocks (proposed %v, expected %v)", + proposeCount, expectCount) + } }) } @@ -116,8 +120,12 @@ func TestValidator_Sign(t *testing.T) { require.False(t, signCount == 0 && expectCount > 0, "validator did not sign any blocks (expected %v)", expectCount) - require.Less(t, float64(expectCount-signCount)/float64(expectCount), 0.33, - "validator missed signing too many blocks (signed %v out of %v)", signCount, expectCount) + if expectCount > 3 { + require.GreaterOrEqual(t, signCount, 3, "validator didn't sign even 3 blocks") + } else { + require.Equal(t, signCount, expectCount, "validator missed signing blocks (signed %v, expected %v)", + signCount, expectCount) + } }) }