Skip to content

Commit 6619237

Browse files
committed
test: Add log.Crit to core tests
1 parent f902d62 commit 6619237

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

core/main_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@
44
package core
55

66
import (
7+
"os"
78
"testing"
89

910
"go.uber.org/goleak"
1011

1112
"github.com/ava-labs/coreth/core/extstate"
1213
"github.com/ava-labs/coreth/params"
1314
"github.com/ava-labs/coreth/plugin/evm/customtypes"
15+
"github.com/ava-labs/libevm/log"
1416
)
1517

1618
// TestMain uses goleak to verify tests in this package do not leak unexpected
@@ -22,6 +24,9 @@ func TestMain(m *testing.M) {
2224
extstate.RegisterExtras()
2325
params.RegisterExtras()
2426

27+
// May of these tests are likely to fail due to `log.Crit` in goroutines.
28+
log.SetDefault(log.NewLogger(log.NewTerminalHandlerWithLevel(os.Stderr, log.LevelCrit, true)))
29+
2530
opts := []goleak.Option{
2631
// No good way to shut down these goroutines:
2732
goleak.IgnoreTopFunction("github.com/ava-labs/coreth/core/state/snapshot.(*diskLayer).generate"),

0 commit comments

Comments
 (0)