Skip to content

Commit

Permalink
tests: fix flushing in TestVotersReloadFromDiskAfterOneStateProofComm…
Browse files Browse the repository at this point in the history
…itted (algorand#6090)
  • Loading branch information
algorandskiy authored Jul 31, 2024
1 parent 8eca278 commit 05a52e2
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions ledger/ledger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2952,6 +2952,19 @@ func testVotersReloadFromDiskAfterOneStateProofCommitted(t *testing.T, cfg confi
<-l.trackers.commitSyncerClosed
l.trackers.commitSyncerClosed = nil

// it is possible a commmit was scheduled while commitSyncer was closing so that there is one pending task
// that required to be done before before the ledger can be closed, so drain the queue
outer:
for {
select {
case <-l.trackers.deferredCommits:
log.Info("drained deferred commit")
l.trackers.accountsWriting.Done()
default:
break outer
}
}

// flush one final time
triggerTrackerFlush(t, l)

Expand Down

0 comments on commit 05a52e2

Please sign in to comment.