paritytech / substrate

Substrate: The platform for blockchain innovators
Apache License 2.0
8.39k stars 2.65k forks source link

sc-consensus-beefy: fix flaky test beefy_reports_equivocations #14382

Closed acatangiu closed 1 year ago

acatangiu commented 1 year ago

Test was using too small a timeout of 250ms to verify equivocation is reported.

If the test machine is loaded with many async tasks running, the voters work and subsequent gossiping does not fit within the 250ms window.

Do multiple tries to verify equivocation reporting with exponential timeouts, most times it will be within 250ms, but the test will retry several times up to 5seconds total before giving up.

Part of https://github.com/paritytech/polkadot-sdk/issues/48