Skip to content

Commit a18b86e

Browse files
holimanzfy0701
authored andcommitted
eth/catalyst, core/txpool/blobpool: make tests output less logs (ethereum#30563)
A couple of tests set the debug level to `TRACE` on stdout, and all subsequent tests in the same package are also affected by that, resulting in outputs of tens of megabytes. This PR removes such calls from two packages where it was prevalent. This makes getting a summary of failing tests simpler, and possibly reduces some strain from the CI pipeline.
1 parent 3bc4ec0 commit a18b86e

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

core/txpool/blobpool/blobpool_test.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ import (
3838
"github.com/ethereum/go-ethereum/core/types"
3939
"github.com/ethereum/go-ethereum/crypto"
4040
"github.com/ethereum/go-ethereum/crypto/kzg4844"
41-
"github.com/ethereum/go-ethereum/log"
4241
"github.com/ethereum/go-ethereum/params"
4342
"github.com/ethereum/go-ethereum/rlp"
4443
"github.com/holiman/billy"
@@ -314,7 +313,7 @@ func verifyPoolInternals(t *testing.T, pool *BlobPool) {
314313
// - 8. Fully duplicate transactions (matching hash) must be dropped
315314
// - 9. Duplicate nonces from the same account must be dropped
316315
func TestOpenDrops(t *testing.T) {
317-
log.SetDefault(log.NewLogger(log.NewTerminalHandlerWithLevel(os.Stderr, log.LevelTrace, true)))
316+
//log.SetDefault(log.NewLogger(log.NewTerminalHandlerWithLevel(os.Stderr, log.LevelTrace, true)))
318317

319318
// Create a temporary folder for the persistent backend
320319
storage, _ := os.MkdirTemp("", "blobpool-")
@@ -637,7 +636,7 @@ func TestOpenDrops(t *testing.T) {
637636
// - 2. Eviction thresholds are calculated correctly for the sequences
638637
// - 3. Balance usage of an account is totals across all transactions
639638
func TestOpenIndex(t *testing.T) {
640-
log.SetDefault(log.NewLogger(log.NewTerminalHandlerWithLevel(os.Stderr, log.LevelTrace, true)))
639+
//log.SetDefault(log.NewLogger(log.NewTerminalHandlerWithLevel(os.Stderr, log.LevelTrace, true)))
641640

642641
// Create a temporary folder for the persistent backend
643642
storage, _ := os.MkdirTemp("", "blobpool-")
@@ -726,7 +725,7 @@ func TestOpenIndex(t *testing.T) {
726725
// Tests that after indexing all the loaded transactions from disk, a price heap
727726
// is correctly constructed based on the head basefee and blobfee.
728727
func TestOpenHeap(t *testing.T) {
729-
log.SetDefault(log.NewLogger(log.NewTerminalHandlerWithLevel(os.Stderr, log.LevelTrace, true)))
728+
//log.SetDefault(log.NewLogger(log.NewTerminalHandlerWithLevel(os.Stderr, log.LevelTrace, true)))
730729

731730
// Create a temporary folder for the persistent backend
732731
storage, _ := os.MkdirTemp("", "blobpool-")
@@ -813,7 +812,7 @@ func TestOpenHeap(t *testing.T) {
813812
// Tests that after the pool's previous state is loaded back, any transactions
814813
// over the new storage cap will get dropped.
815814
func TestOpenCap(t *testing.T) {
816-
log.SetDefault(log.NewLogger(log.NewTerminalHandlerWithLevel(os.Stderr, log.LevelTrace, true)))
815+
//log.SetDefault(log.NewLogger(log.NewTerminalHandlerWithLevel(os.Stderr, log.LevelTrace, true)))
817816

818817
// Create a temporary folder for the persistent backend
819818
storage, _ := os.MkdirTemp("", "blobpool-")
@@ -905,7 +904,7 @@ func TestOpenCap(t *testing.T) {
905904
// specific to the blob pool. It does not do an exhaustive transaction validity
906905
// check.
907906
func TestAdd(t *testing.T) {
908-
log.SetDefault(log.NewLogger(log.NewTerminalHandlerWithLevel(os.Stderr, log.LevelTrace, true)))
907+
//log.SetDefault(log.NewLogger(log.NewTerminalHandlerWithLevel(os.Stderr, log.LevelTrace, true)))
909908

910909
// seed is a helper tuple to seed an initial state db and pool
911910
type seed struct {

eth/catalyst/api_test.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,12 @@ import (
4242
"github.com/ethereum/go-ethereum/eth"
4343
"github.com/ethereum/go-ethereum/eth/downloader"
4444
"github.com/ethereum/go-ethereum/eth/ethconfig"
45-
"github.com/ethereum/go-ethereum/log"
4645
"github.com/ethereum/go-ethereum/miner"
4746
"github.com/ethereum/go-ethereum/node"
4847
"github.com/ethereum/go-ethereum/p2p"
4948
"github.com/ethereum/go-ethereum/params"
5049
"github.com/ethereum/go-ethereum/rpc"
5150
"github.com/ethereum/go-ethereum/trie"
52-
"github.com/mattn/go-colorable"
5351
)
5452

5553
var (
@@ -1624,7 +1622,7 @@ func TestBlockToPayloadWithBlobs(t *testing.T) {
16241622

16251623
// This checks that beaconRoot is applied to the state from the engine API.
16261624
func TestParentBeaconBlockRoot(t *testing.T) {
1627-
log.SetDefault(log.NewLogger(log.NewTerminalHandlerWithLevel(colorable.NewColorableStderr(), log.LevelTrace, true)))
1625+
//log.SetDefault(log.NewLogger(log.NewTerminalHandlerWithLevel(colorable.NewColorableStderr(), log.LevelTrace, true)))
16281626

16291627
genesis, blocks := generateMergeChain(10, true)
16301628

@@ -1706,7 +1704,7 @@ func TestParentBeaconBlockRoot(t *testing.T) {
17061704
}
17071705

17081706
func TestWitnessCreationAndConsumption(t *testing.T) {
1709-
log.SetDefault(log.NewLogger(log.NewTerminalHandlerWithLevel(colorable.NewColorableStderr(), log.LevelTrace, true)))
1707+
//log.SetDefault(log.NewLogger(log.NewTerminalHandlerWithLevel(colorable.NewColorableStderr(), log.LevelTrace, true)))
17101708

17111709
genesis, blocks := generateMergeChain(10, true)
17121710

0 commit comments

Comments
 (0)