mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 05:06:43 +00:00
core/state: reopen triedb to ensure buffer flushed
This commit is contained in:
parent
47fc9684a8
commit
a50f220ab3
1 changed files with 8 additions and 0 deletions
|
|
@ -94,6 +94,14 @@ func TestSizeTracker(t *testing.T) {
|
|||
}
|
||||
baselineRoot := currentRoot
|
||||
|
||||
// Close and reopen the trie database so all async flushes triggered by the
|
||||
// baseline commits are written before we measure the baseline snapshot.
|
||||
if err := tdb.Close(); err != nil {
|
||||
t.Fatalf("Failed to close triedb before baseline measurement: %v", err)
|
||||
}
|
||||
tdb = triedb.NewDatabase(db, &triedb.Config{PathDB: pathdb.Defaults})
|
||||
sdb = NewDatabase(tdb, nil)
|
||||
|
||||
// Wait for snapshot completion
|
||||
for !tdb.SnapshotCompleted() {
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
|
|
|
|||
Loading…
Reference in a new issue