From aabcfb2aa03391f457459d6494722f3a3592aefa Mon Sep 17 00:00:00 2001 From: Gustavo Grieco <31542053+ggrieco-tob@users.noreply.github.com> Date: Tue, 29 Aug 2023 12:50:46 +0200 Subject: [PATCH] test: avoid evidenceFraction parameter to be very close to 1.0 (#16978) Co-authored-by: Marko Co-authored-by: Marko --- x/simulation/mock_cometbft.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/x/simulation/mock_cometbft.go b/x/simulation/mock_cometbft.go index 336108adc0..8fc569ddac 100644 --- a/x/simulation/mock_cometbft.go +++ b/x/simulation/mock_cometbft.go @@ -184,6 +184,12 @@ func RandomRequestFinalizeBlock( // TODO: Determine capacity before allocation evidence := make([]abci.Misbehavior, 0) + // If the evidenceFraction value is to close to 1.0, + // the following loop will most likely never end + if params.EvidenceFraction() > 0.9 { + // Reduce the evidenceFraction to a more sane value + params.evidenceFraction = 0.9 + } for r.Float64() < params.EvidenceFraction() { vals := voteInfos