From 8adddbcd13407bf627e838eacb0469c5107c90cc Mon Sep 17 00:00:00 2001 From: cce <51567+cce@users.noreply.github.com> Date: Thu, 19 Dec 2024 14:39:17 -0500 Subject: [PATCH] update TestCatchpointFastUpdates to give one more kick if DB commits fall behind --- ledger/catchpointtracker_test.go | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/ledger/catchpointtracker_test.go b/ledger/catchpointtracker_test.go index c17ee51378..fcccdb5831 100644 --- a/ledger/catchpointtracker_test.go +++ b/ledger/catchpointtracker_test.go @@ -1882,10 +1882,6 @@ func TestHashContract(t *testing.T) { func TestCatchpointFastUpdates(t *testing.T) { partitiontest.PartitionTest(t) - if runtime.GOARCH == "arm" || runtime.GOARCH == "arm64" { - t.Skip("This test is too slow on ARM and causes CI builds to time out") - } - proto := config.Consensus[protocol.ConsensusFuture] accts := []map[basics.Address]basics.AccountData{ledgertesting.RandomAccounts(20, true)} @@ -1925,6 +1921,7 @@ func TestCatchpointFastUpdates(t *testing.T) { wg := sync.WaitGroup{} + lastRound := basics.Round(0) for i := basics.Round(initialBlocksCount); i < basics.Round(proto.CatchpointLookback+15); i++ { rewardLevelDelta := crypto.RandUint64() % 5 rewardLevel += rewardLevelDelta @@ -1959,10 +1956,21 @@ func TestCatchpointFastUpdates(t *testing.T) { defer wg.Done() ml.trackers.committedUpTo(round) }(i) + lastRound = i } wg.Wait() ml.trackers.waitAccountsWriting() + if ml.trackers.getDbRound() <= basics.Round(proto.CatchpointLookback) { + // db round stuck <= 320? likely committedUpTo dropped some commit tasks, due to deferredCommits channel full + // so give it another try + ml.trackers.committedUpTo(lastRound) + require.Eventually(t, func() bool { + //ml.trackers.waitAccountsWriting() + return ml.trackers.getDbRound() > basics.Round(proto.CatchpointLookback) + }, 5*time.Second, 100*time.Millisecond) + } + require.NotEmpty(t, ct.GetLastCatchpointLabel()) }