From 21c257f1062026bfe00cce1183487553422f9904 Mon Sep 17 00:00:00 2001 From: Conner Fromknecht Date: Wed, 13 Dec 2017 01:55:09 -0800 Subject: [PATCH] fundingmanager_test: remove race condition in fmgr log --- fundingmanager_test.go | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/fundingmanager_test.go b/fundingmanager_test.go index 02698fef..692bc8a9 100644 --- a/fundingmanager_test.go +++ b/fundingmanager_test.go @@ -132,7 +132,7 @@ type testNode struct { shutdownChannel chan struct{} } -func disableFndgLogger(t *testing.T) { +func init() { channeldb.UseLogger(btclog.Disabled) lnwallet.UseLogger(btclog.Disabled) fndgLog = btclog.Disabled @@ -802,8 +802,6 @@ func assertHandleFundingLocked(t *testing.T, alice, bob *testNode) { } func TestFundingManagerNormalWorkflow(t *testing.T) { - disableFndgLogger(t) - alice, bob := setupFundingManagers(t) defer tearDownFundingManagers(t, alice, bob) @@ -866,8 +864,6 @@ func TestFundingManagerNormalWorkflow(t *testing.T) { } func TestFundingManagerRestartBehavior(t *testing.T) { - disableFndgLogger(t) - alice, bob := setupFundingManagers(t) defer tearDownFundingManagers(t, alice, bob) @@ -986,8 +982,6 @@ func TestFundingManagerRestartBehavior(t *testing.T) { // server to notify when the peer comes online, in case sending the // fundingLocked message fails the first time. func TestFundingManagerOfflinePeer(t *testing.T) { - disableFndgLogger(t) - alice, bob := setupFundingManagers(t) defer tearDownFundingManagers(t, alice, bob) @@ -1114,8 +1108,6 @@ func TestFundingManagerOfflinePeer(t *testing.T) { } func TestFundingManagerFundingTimeout(t *testing.T) { - disableFndgLogger(t) - alice, bob := setupFundingManagers(t) defer tearDownFundingManagers(t, alice, bob) @@ -1158,8 +1150,6 @@ func TestFundingManagerFundingTimeout(t *testing.T) { // continues to operate as expected in case we receive a duplicate fundingLocked // message. func TestFundingManagerReceiveFundingLockedTwice(t *testing.T) { - disableFndgLogger(t) - alice, bob := setupFundingManagers(t) defer tearDownFundingManagers(t, alice, bob) @@ -1257,8 +1247,6 @@ func TestFundingManagerReceiveFundingLockedTwice(t *testing.T) { // handles receiving a fundingLocked after the its own fundingLocked and channel // announcement is sent and gets restarted. func TestFundingManagerRestartAfterChanAnn(t *testing.T) { - disableFndgLogger(t) - alice, bob := setupFundingManagers(t) defer tearDownFundingManagers(t, alice, bob) @@ -1329,8 +1317,6 @@ func TestFundingManagerRestartAfterChanAnn(t *testing.T) { // fundingManager continues to operate as expected after it has received // fundingLocked and then gets restarted. func TestFundingManagerRestartAfterReceivingFundingLocked(t *testing.T) { - disableFndgLogger(t) - alice, bob := setupFundingManagers(t) defer tearDownFundingManagers(t, alice, bob) @@ -1397,8 +1383,6 @@ func TestFundingManagerRestartAfterReceivingFundingLocked(t *testing.T) { // (a channel not supposed to be announced to the rest of the network), // the announcementSignatures nor the nodeAnnouncement messages are sent. func TestFundingManagerPrivateChannel(t *testing.T) { - disableFndgLogger(t) - alice, bob := setupFundingManagers(t) defer tearDownFundingManagers(t, alice, bob) @@ -1475,8 +1459,6 @@ func TestFundingManagerPrivateChannel(t *testing.T) { // announcement signatures nor the node announcement messages are sent upon // restart. func TestFundingManagerPrivateRestart(t *testing.T) { - disableFndgLogger(t) - alice, bob := setupFundingManagers(t) defer tearDownFundingManagers(t, alice, bob)