mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-20 13:04:28 +02:00
peer: fix unit test flake
This commit is contained in:
@@ -1267,18 +1267,6 @@ func TestHandleRemovePendingChannel(t *testing.T) {
|
|||||||
chanIDNotExist := lnwire.ChannelID{1}
|
chanIDNotExist := lnwire.ChannelID{1}
|
||||||
chanIDPending := lnwire.ChannelID{2}
|
chanIDPending := lnwire.ChannelID{2}
|
||||||
|
|
||||||
// Create a test brontide.
|
|
||||||
dummyConfig := Config{}
|
|
||||||
peer := NewBrontide(dummyConfig)
|
|
||||||
|
|
||||||
// Create the test state.
|
|
||||||
peer.activeChannels.Store(chanIDActive, &lnwallet.LightningChannel{})
|
|
||||||
peer.activeChannels.Store(chanIDPending, nil)
|
|
||||||
|
|
||||||
// Assert test state, we should have two channels store, one active and
|
|
||||||
// one pending.
|
|
||||||
require.Equal(t, 2, peer.activeChannels.Len())
|
|
||||||
|
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
name string
|
name string
|
||||||
chanID lnwire.ChannelID
|
chanID lnwire.ChannelID
|
||||||
@@ -1314,8 +1302,23 @@ func TestHandleRemovePendingChannel(t *testing.T) {
|
|||||||
err: errChan,
|
err: errChan,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Create a test brontide.
|
||||||
|
dummyConfig := Config{}
|
||||||
|
peer := NewBrontide(dummyConfig)
|
||||||
|
|
||||||
|
// Create the test state.
|
||||||
|
peer.activeChannels.Store(
|
||||||
|
chanIDActive, &lnwallet.LightningChannel{},
|
||||||
|
)
|
||||||
|
peer.activeChannels.Store(chanIDPending, nil)
|
||||||
|
|
||||||
|
// Assert test state, we should have two channels store, one
|
||||||
|
// active and one pending.
|
||||||
|
require.Equal(t, 2, peer.activeChannels.Len())
|
||||||
|
|
||||||
t.Run(tc.name, func(t *testing.T) {
|
t.Run(tc.name, func(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
require := require.New(t)
|
require := require.New(t)
|
||||||
|
|
||||||
// Get the number of channels before mutating the
|
// Get the number of channels before mutating the
|
||||||
|
Reference in New Issue
Block a user