From 46328945623ff9c3a210d3f825a970a4748c8a7c Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Fri, 5 Feb 2016 12:32:23 -0800 Subject: [PATCH] lnwallet: move teardown of rpctest before setup to ensure proper cleanup * Previously, if the call to SetUp(..) returned an error, then the test harness would fail to stop the running bcd process, and clean up the test directories. This would cause any subsequent tests to fail. This commit remedies this scenario. --- lnwallet/wallet_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lnwallet/wallet_test.go b/lnwallet/wallet_test.go index 64267bb16..6ea406f28 100644 --- a/lnwallet/wallet_test.go +++ b/lnwallet/wallet_test.go @@ -573,13 +573,13 @@ func TestLightningWallet(t *testing.T) { // up this node with a chain length of 125, so we have plentyyy of BTC // to play around with. miningNode, err := rpctest.New(netParams, nil, nil) + defer miningNode.TearDown() if err != nil { t.Fatalf("unable to create mining node: %v", err) } if err := miningNode.SetUp(true, 25); err != nil { t.Fatalf("unable to set up mining node: %v", err) } - defer miningNode.TearDown() // Funding via 5 outputs with 4BTC each. testDir, lnwallet, err := createTestWallet(miningNode, netParams)