test: hack fix of panic by disabling btcrpcclient log

This commit is contained in:
Andrey Samokhvalov authored and Olaoluwa Osuntokun committed 2017-06-25 14:19:56 +01:00
1 parent 8fa2b95c12
commit aed2e5865f
2 files changed
+7 -1

No files matched your search

-1
View File
@@ -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 {
+7
View File
@@ -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)
}