tests: cleanup snapshot generator goroutine leak

This commit is contained in:
Péter Szilágyi
2020-05-04 11:54:24 +03:00
parent 510b6f90db
commit 65cd28aa0e
5 changed files with 30 additions and 19 deletions

View File

@ -79,7 +79,15 @@ type vmExecMarshaling struct {
}
func (t *VMTest) Run(vmconfig vm.Config, snapshotter bool) error {
statedb := MakePreState(rawdb.NewMemoryDatabase(), t.json.Pre, snapshotter)
snaps, statedb := MakePreState(rawdb.NewMemoryDatabase(), t.json.Pre, snapshotter)
if snapshotter {
preRoot := statedb.IntermediateRoot(false)
defer func() {
if _, err := snaps.Journal(preRoot); err != nil {
panic(err)
}
}()
}
ret, gasRemaining, err := t.exec(statedb, vmconfig)
if t.json.GasRemaining == nil {