Skip to content

Commit

Permalink
chainntnfs: ensure previous test succeeded before running
Browse files Browse the repository at this point in the history
  • Loading branch information
yyforyongyu committed Dec 10, 2024
1 parent fb429d6 commit f03e242
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
12 changes: 10 additions & 2 deletions chainntnfs/bitcoindnotify/bitcoind_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,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) {
t.Run("rpc polling enabled", func(st *testing.T) {
success := t.Run("rpc polling enabled", func(st *testing.T) {
st.Parallel()
testHistoricalConfDetailsTxIndex(st, true)
})

if !success {
return
}

t.Run("rpc polling disabled", func(st *testing.T) {
st.Parallel()
testHistoricalConfDetailsTxIndex(st, false)
Expand Down Expand Up @@ -207,11 +211,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) {
t.Run("rpc polling enabled", func(st *testing.T) {
success := t.Run("rpc polling enabled", func(st *testing.T) {
st.Parallel()
testHistoricalConfDetailsNoTxIndex(st, true)
})

if !success {
return
}

t.Run("rpc polling disabled", func(st *testing.T) {
st.Parallel()
testHistoricalConfDetailsNoTxIndex(st, false)
Expand Down
6 changes: 5 additions & 1 deletion chainntnfs/test/bitcoind/bitcoind_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@ import (
// TestInterfaces executes the generic notifier test suite against a bitcoind
// powered chain notifier.
func TestInterfaces(t *testing.T) {
t.Run("bitcoind", func(st *testing.T) {
success := t.Run("bitcoind", func(st *testing.T) {
st.Parallel()
chainntnfstest.TestInterfaces(st, "bitcoind")
})

if !success {
return
}

t.Run("bitcoind rpc polling", func(st *testing.T) {
st.Parallel()
chainntnfstest.TestInterfaces(st, "bitcoind-rpc-polling")
Expand Down
6 changes: 5 additions & 1 deletion chainntnfs/txnotifier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ func TestTxNotifierRegistrationValidation(t *testing.T) {

for _, testCase := range testCases {
testCase := testCase
t.Run(testCase.name, func(t *testing.T) {
success := t.Run(testCase.name, func(t *testing.T) {
hintCache := newMockHintCache()
n := chainntnfs.NewTxNotifier(
10, chainntnfs.ReorgSafetyLimit, hintCache, hintCache,
Expand Down Expand Up @@ -201,6 +201,10 @@ func TestTxNotifierRegistrationValidation(t *testing.T) {
"\"%v\", got \"%v\"", testCase.err, err)
}
})

if !success {
return
}
}
}

Expand Down

0 comments on commit f03e242

Please sign in to comment.