From 42afa009d01c0ce5a6e9f32db31c133131e8b2ce Mon Sep 17 00:00:00 2001 From: buddh0 Date: Wed, 20 Nov 2024 14:09:06 +0800 Subject: [PATCH] TestTailTruncateHistory clear up --- triedb/pathdb/database_test.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/triedb/pathdb/database_test.go b/triedb/pathdb/database_test.go index 5b4e599cc7..da8252ad7f 100644 --- a/triedb/pathdb/database_test.go +++ b/triedb/pathdb/database_test.go @@ -21,7 +21,6 @@ import ( "errors" "fmt" "math/rand" - "os" "testing" "github.com/ethereum/go-ethereum/common" @@ -29,7 +28,6 @@ import ( "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" @@ -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 @@ -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 {