Fantom-foundation / Aida

Aida is a block-processing testing infrastructure for EVM-compatible chains.
GNU Lesser General Public License v3.0
6 stars 12 forks source link

Kjezek/fix flaky test #1210

Closed kjezek closed 1 month ago

kjezek commented 1 month ago

This PR fixes flaky test discovered by Carmen pipeline:

https://scala.fantom.network/job/Carmen/job/Validate-Witness-Proof/63/console

20:45:37  --- FAIL: TestProcessor_ProcessErrorAbortsProcessing_TransactionLevelParallelism (0.00s)
20:45:37      executor.go:498: Unexpected call to *executor.MockProcessor[interface {}].Process([{201 7 <nil>} 0xc005370300]) at /tmp/workspace/Carmen/Validate-Witness-Proof/executor/executor.go:498 because: 
20:45:37          expected call at /tmp/workspace/Carmen/Validate-Witness-Proof/executor/executor_test.go:954 doesn't match the argument at index 0.
20:45:37          Got: {201 7 <nil>} (executor.State[interface {}])
20:45:37          Want: at block 4
20:45:37          expected call at /tmp/workspace/Carmen/Validate-Witness-Proof/executor/executor_test.go:955 has already been called the max number of times

The issue of the test was that it sets two expectations to a single method call, which makes the framework puzzled what to do. It turns that it mostly worked, but could fail randomly.