From 18736839e4b04ff8e592e04a6c442274a69bf9ab Mon Sep 17 00:00:00 2001 From: Josh Klopfenstein Date: Sat, 7 Sep 2024 16:24:19 -0500 Subject: [PATCH] Capture root logger output in e2e tests This [would have helped us] find the reorg error much faster. [would have helped us]: https://github.com/ethereum-optimism/optimism/pull/11756 --- e2e/stack_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/e2e/stack_test.go b/e2e/stack_test.go index c09c3f80..2aed12d8 100644 --- a/e2e/stack_test.go +++ b/e2e/stack_test.go @@ -68,6 +68,10 @@ func TestE2E(t *testing.T) { require.NoError(t, env.Close()) }() + // Unfortunately, geth and parts of the OP Stack occasionally use the root logger. + // We capture the root logger's output in a separate file. + log.SetDefault(log.NewLogger(log.NewTerminalHandler(openLogFile(t, env, "root-logger"), false))) + if err := os.Mkdir(artifactsDirectoryName, 0o755); !errors.Is(err, os.ErrExist) { require.NoError(t, err) }