From aed2e5865f59ae003c089264bb571c48f84da287 Mon Sep 17 00:00:00 2001 From: Andrey Samokhvalov Date: Sun, 25 Jun 2017 15:05:26 +0300 Subject: [PATCH] test: hack fix of panic by disabling btcrpcclient log --- config.go | 1 - lnd_test.go | 7 +++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/config.go b/config.go index 5b8452fa..7584a473 100644 --- a/config.go +++ b/config.go @@ -290,7 +290,6 @@ func loadConfig() (*config, error) { // Initialize logging at the default logging level. initLogRotator(filepath.Join(cfg.LogDir, defaultLogFilename)) - setLogLevels(defaultLogLevel) // Parse, validate, and set debug log level(s). if err := parseAndSetDebugLevels(cfg.DebugLevel); err != nil { diff --git a/lnd_test.go b/lnd_test.go index aada3b6a..4cc5a9b0 100644 --- a/lnd_test.go +++ b/lnd_test.go @@ -19,6 +19,7 @@ import ( "math/rand" + "github.com/btcsuite/btclog" "github.com/davecgh/go-spew/spew" "github.com/go-errors/errors" "github.com/lightningnetwork/lnd/lnrpc" @@ -3015,6 +3016,12 @@ func TestLightningNetworkDaemon(t *testing.T) { ht.Fatalf("unable to create mining node: %v", err) } defer btcdHarness.TearDown() + + // Turn off the btcd rpc logging, otherwise it will lead to panic. + // TODO(andrew.shvv|roasbeef) Remove the hack after re-work the way the log + // rotator os work. + btcrpcclient.UseLogger(btclog.Disabled) + if err := btcdHarness.SetUp(true, 50); err != nil { ht.Fatalf("unable to set up mining node: %v", err) }