From 1f67d6a5488c8c9a0f68e48ce6b14e28a0aed856 Mon Sep 17 00:00:00 2001 From: yyforyongyu Date: Wed, 18 Jan 2023 15:51:25 +0800 Subject: [PATCH] bitcoindnotify: fix subtest closure in unit tests --- chainntnfs/bitcoindnotify/bitcoind_test.go | 22 ++++++++++++++++++---- chainntnfs/test/bitcoind/bitcoind_test.go | 11 +++++++++-- docs/release-notes/release-notes-0.16.0.md | 3 +++ 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/chainntnfs/bitcoindnotify/bitcoind_test.go b/chainntnfs/bitcoindnotify/bitcoind_test.go index 00ed31b30..9a89d3454 100644 --- a/chainntnfs/bitcoindnotify/bitcoind_test.go +++ b/chainntnfs/bitcoindnotify/bitcoind_test.go @@ -105,8 +105,15 @@ func syncNotifierWithMiner(t *testing.T, notifier *BitcoindNotifier, // TestHistoricalConfDetailsTxIndex ensures that we correctly retrieve // historical confirmation details using the backend node's txindex. func TestHistoricalConfDetailsTxIndex(t *testing.T) { - testHistoricalConfDetailsTxIndex(t, true) - testHistoricalConfDetailsTxIndex(t, false) + t.Run("txindex enabled", func(st *testing.T) { + st.Parallel() + testHistoricalConfDetailsTxIndex(st, true) + }) + + t.Run("txindex disabled", func(st *testing.T) { + st.Parallel() + testHistoricalConfDetailsTxIndex(st, false) + }) } func testHistoricalConfDetailsTxIndex(t *testing.T, rpcPolling bool) { @@ -193,8 +200,15 @@ func testHistoricalConfDetailsTxIndex(t *testing.T, rpcPolling bool) { // historical confirmation details using the set of fallback methods when the // backend node's txindex is disabled. func TestHistoricalConfDetailsNoTxIndex(t *testing.T) { - testHistoricalConfDetailsNoTxIndex(t, true) - testHistoricalConfDetailsNoTxIndex(t, false) + t.Run("txindex enabled", func(st *testing.T) { + st.Parallel() + testHistoricalConfDetailsNoTxIndex(st, true) + }) + + t.Run("txindex disabled", func(st *testing.T) { + st.Parallel() + testHistoricalConfDetailsNoTxIndex(st, false) + }) } func testHistoricalConfDetailsNoTxIndex(t *testing.T, rpcpolling bool) { diff --git a/chainntnfs/test/bitcoind/bitcoind_test.go b/chainntnfs/test/bitcoind/bitcoind_test.go index 38779f8c7..cc379de81 100644 --- a/chainntnfs/test/bitcoind/bitcoind_test.go +++ b/chainntnfs/test/bitcoind/bitcoind_test.go @@ -12,6 +12,13 @@ import ( // TestInterfaces executes the generic notifier test suite against a bitcoind // powered chain notifier. func TestInterfaces(t *testing.T) { - chainntnfstest.TestInterfaces(t, "bitcoind") - chainntnfstest.TestInterfaces(t, "bitcoind-rpc-polling") + t.Run("bitcoind", func(st *testing.T) { + st.Parallel() + chainntnfstest.TestInterfaces(st, "bitcoind") + }) + + t.Run("bitcoind rpc polling", func(st *testing.T) { + st.Parallel() + chainntnfstest.TestInterfaces(st, "bitcoind-rpc-polling") + }) } diff --git a/docs/release-notes/release-notes-0.16.0.md b/docs/release-notes/release-notes-0.16.0.md index 92338cd9f..34391cca3 100644 --- a/docs/release-notes/release-notes-0.16.0.md +++ b/docs/release-notes/release-notes-0.16.0.md @@ -300,6 +300,9 @@ data. * Payment related code [has been refactored](https://github.com/lightningnetwork/lnd/pull/7174) to allow the usage of new payment statuses. + +* [Fixed a test closure](https://github.com/lightningnetwork/lnd/pull/7337) + issue found in `bitcoindnotify/bitcoind_test.go`. ## Watchtowers