From 8f5ddf39cac8cb3877f35552cf4a7ac205adcaf7 Mon Sep 17 00:00:00 2001 From: Conner Fromknecht Date: Wed, 3 Apr 2019 17:23:12 -0700 Subject: [PATCH] lnd_test: use child harness chan backup restore cases This prevents a panic during test failure due to a child test calling FailNow on a parent test context. The sub tests now capture the testing.T object provided in each closure as opposed to ignoring it and using the parent context. --- lnd_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lnd_test.go b/lnd_test.go index 52809049b..487d02fcd 100644 --- a/lnd_test.go +++ b/lnd_test.go @@ -13847,8 +13847,9 @@ func testChannelBackupRestore(net *lntest.NetworkHarness, t *harnessTest) { // ann is updated? for _, testCase := range testCases { - success := t.t.Run(testCase.name, func(_ *testing.T) { - testChanRestoreScenario(t, net, &testCase, password) + success := t.t.Run(testCase.name, func(t *testing.T) { + h := newHarnessTest(t) + testChanRestoreScenario(h, net, &testCase, password) }) if !success { break