diff --git a/ledger/catchpointfilewriter_test.go b/ledger/catchpointfilewriter_test.go index d436e0de8c..72557466f6 100644 --- a/ledger/catchpointfilewriter_test.go +++ b/ledger/catchpointfilewriter_test.go @@ -905,11 +905,10 @@ func testExactAccountChunk(t *testing.T, proto protocol.ConsensusVersion, extraB dl.fullBlock(&selfpay) } - genR, _ := testCatchpointFlushRound(dl.generator) - valR, _ := testCatchpointFlushRound(dl.validator) - require.Equal(t, genR, valR) - require.EqualValues(t, BalancesPerCatchpointFileChunk-12+extraBlocks, genR) + testCatchpointFlushRound(dl.generator) + testCatchpointFlushRound(dl.validator) + // wait for the two ledgers to finish committing and be in sync require.Eventually(t, func() bool { dl.generator.accts.accountsMu.RLock() dlg := len(dl.generator.accts.deltas) @@ -920,6 +919,10 @@ func testExactAccountChunk(t *testing.T, proto protocol.ConsensusVersion, extraB dl.validator.accts.accountsMu.RUnlock() return dlg == dlv && dl.generator.Latest() == dl.validator.Latest() }, 10*time.Second, 100*time.Millisecond) + genR, _ := dl.generator.LatestCommitted() + valR, _ := dl.validator.LatestCommitted() + require.Equal(t, genR, valR) + require.EqualValues(t, BalancesPerCatchpointFileChunk-12+extraBlocks, genR) tempDir := t.TempDir()