Skip to content

Commit

Permalink
TestTailTruncateHistory clear up
Browse files Browse the repository at this point in the history
  • Loading branch information
buddh0 committed Nov 20, 2024
1 parent 496f0bf commit 42afa00
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions triedb/pathdb/database_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,13 @@ import (
"errors"
"fmt"
"math/rand"
"os"
"testing"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/rawdb"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/internal/testrand"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/rlp"
"github.com/ethereum/go-ethereum/trie"
"github.com/ethereum/go-ethereum/trie/trienode"
Expand Down Expand Up @@ -630,7 +628,6 @@ func TestCorruptedJournal(t *testing.T) {
// always falls within the range of [oldest-history-id, latest-history-id].
func TestTailTruncateHistory(t *testing.T) {
// Redefine the diff layer depth allowance for faster testing.
log.SetDefault(log.NewLogger(log.NewTerminalHandlerWithLevel(os.Stderr, log.LevelTrace, true)))
maxDiffLayers = 4
defer func() {
maxDiffLayers = 128
Expand All @@ -640,9 +637,8 @@ func TestTailTruncateHistory(t *testing.T) {
defer tester.release()

// ignore error, whether `Journal` success or not, this UT must succeed
_ = tester.db.Journal(tester.lastHash())
_ = tester.db.Close()

tester.db.Journal(tester.lastHash())
tester.db.Close()
tester.db = New(tester.db.diskdb, &Config{StateHistory: 10}, false)
head, err := tester.db.freezer.Ancients()
if err != nil {
Expand Down

0 comments on commit 42afa00

Please sign in to comment.