From ec2746061618ce21b2ef756ab6b16ef8e7f6655a Mon Sep 17 00:00:00 2001 From: Pavel Zbitskiy Date: Wed, 13 Sep 2023 13:37:48 -0400 Subject: [PATCH] tests: fix flaky simulate test --- test/e2e-go/restAPI/simulate/simulateRestAPI_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/e2e-go/restAPI/simulate/simulateRestAPI_test.go b/test/e2e-go/restAPI/simulate/simulateRestAPI_test.go index c70767713d..9d44e031ec 100644 --- a/test/e2e-go/restAPI/simulate/simulateRestAPI_test.go +++ b/test/e2e-go/restAPI/simulate/simulateRestAPI_test.go @@ -340,7 +340,12 @@ int 1` // There should be a failure when the round is too far back simulateRequest.Round = basics.Round(followerSyncRound - 3) - result, err = simulateTransactions(simulateRequest) + require.Eventually(t, func() bool { + // use Eventually to workaround the ledger delays with committing accounts + result, err = simulateTransactions(simulateRequest) + return err != nil + }, 6*time.Second, 500*time.Millisecond) + a.Error(err) var httpErr client.HTTPError a.ErrorAs(err, &httpErr)