mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-06-29 10:09:08 +02:00
itest: document a flake found on macOS
This commit is contained in:
@ -1,6 +1,7 @@
|
|||||||
package itest
|
package itest
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"runtime"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/btcutil"
|
"github.com/btcsuite/btcd/btcutil"
|
||||||
@ -70,3 +71,36 @@ func flakeTxNotifierNeutrino(ht *lntest.HarnessTest) {
|
|||||||
ht.MineEmptyBlocks(1)
|
ht.MineEmptyBlocks(1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// flakeSkipPendingSweepsCheckDarwin documents a flake found only in macOS
|
||||||
|
// build. When running in macOS, we might see three anchor sweeps - one from the
|
||||||
|
// local, one from the remote, and one from the pending remote:
|
||||||
|
// - the local one will be swept.
|
||||||
|
// - the remote one will be marked as failed due to `testmempoolaccept` check.
|
||||||
|
// - the pending remote one will not be attempted due to it being uneconomical
|
||||||
|
// since it was not used for CPFP.
|
||||||
|
//
|
||||||
|
// The anchor from the pending remote may or may not appear, which is a bug
|
||||||
|
// found only in macOS - when updating the commitments, the channel state
|
||||||
|
// machine somehow thinks we still have a pending remote commitment, causing it
|
||||||
|
// to sweep the anchor from that version.
|
||||||
|
//
|
||||||
|
// TODO(yy): fix the above bug in the channel state machine.
|
||||||
|
func flakeSkipPendingSweepsCheckDarwin(ht *lntest.HarnessTest,
|
||||||
|
node *node.HarnessNode, num int) {
|
||||||
|
|
||||||
|
// Skip the assertion below if it's on macOS.
|
||||||
|
if isDarwin() {
|
||||||
|
ht.Logf("Skipped AssertNumPendingSweeps for node %s",
|
||||||
|
node.Name())
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
ht.AssertNumPendingSweeps(node, num)
|
||||||
|
}
|
||||||
|
|
||||||
|
// isDarwin returns true if the test is running on a macOS.
|
||||||
|
func isDarwin() bool {
|
||||||
|
return runtime.GOOS == "darwin"
|
||||||
|
}
|
||||||
|
@ -423,22 +423,7 @@ func runLocalClaimOutgoingHTLC(ht *lntest.HarnessTest,
|
|||||||
numSweeps = 2
|
numSweeps = 2
|
||||||
}
|
}
|
||||||
|
|
||||||
// When running in macOS, we might see three anchor sweeps - one from
|
flakeSkipPendingSweepsCheckDarwin(ht, bob, numSweeps)
|
||||||
// the local, one from the remote, and one from the pending remote:
|
|
||||||
// - the local one will be swept.
|
|
||||||
// - the remote one will be marked as failed due to `testmempoolaccept`
|
|
||||||
// check.
|
|
||||||
// - the pending remote one will not be attempted due to it being
|
|
||||||
// uneconomical since it was not used for CPFP.
|
|
||||||
// The anchor from the pending remote may or may not appear, which is a
|
|
||||||
// bug found only in macOS - when updating the commitments, the channel
|
|
||||||
// state machine somehow thinks we still have a pending remote
|
|
||||||
// commitment, causing it to sweep the anchor from that version.
|
|
||||||
//
|
|
||||||
// TODO(yy): fix the above bug in the channel state machine.
|
|
||||||
if !isDarwin() {
|
|
||||||
ht.AssertNumPendingSweeps(bob, numSweeps)
|
|
||||||
}
|
|
||||||
|
|
||||||
// We expect to see tow txns in the mempool,
|
// We expect to see tow txns in the mempool,
|
||||||
// 1. Bob's force close tx.
|
// 1. Bob's force close tx.
|
||||||
@ -795,22 +780,7 @@ func runMultiHopReceiverPreimageClaim(ht *lntest.HarnessTest,
|
|||||||
numSweeps = 2
|
numSweeps = 2
|
||||||
}
|
}
|
||||||
|
|
||||||
// When running in macOS, we might see three anchor sweeps - one from
|
flakeSkipPendingSweepsCheckDarwin(ht, carol, numSweeps)
|
||||||
// the local, one from the remote, and one from the pending remote:
|
|
||||||
// - the local one will be swept.
|
|
||||||
// - the remote one will be marked as failed due to `testmempoolaccept`
|
|
||||||
// check.
|
|
||||||
// - the pending remote one will not be attempted due to it being
|
|
||||||
// uneconomical since it was not used for CPFP.
|
|
||||||
// The anchor from the pending remote may or may not appear, which is a
|
|
||||||
// bug found only in macOS - when updating the commitments, the channel
|
|
||||||
// state machine somehow thinks we still have a pending remote
|
|
||||||
// commitment, causing it to sweep the anchor from that version.
|
|
||||||
//
|
|
||||||
// TODO(yy): fix the above bug in the channel state machine.
|
|
||||||
if !isDarwin() {
|
|
||||||
ht.AssertNumPendingSweeps(carol, numSweeps)
|
|
||||||
}
|
|
||||||
|
|
||||||
// We expect to see tow txns in the mempool,
|
// We expect to see tow txns in the mempool,
|
||||||
// 1. Carol's force close tx.
|
// 1. Carol's force close tx.
|
||||||
@ -2365,22 +2335,7 @@ func runLocalPreimageClaim(ht *lntest.HarnessTest,
|
|||||||
numSweeps = 2
|
numSweeps = 2
|
||||||
}
|
}
|
||||||
|
|
||||||
// When running in macOS, we might see three anchor sweeps - one from
|
flakeSkipPendingSweepsCheckDarwin(ht, carol, numSweeps)
|
||||||
// the local, one from the remote, and one from the pending remote:
|
|
||||||
// - the local one will be swept.
|
|
||||||
// - the remote one will be marked as failed due to `testmempoolaccept`
|
|
||||||
// check.
|
|
||||||
// - the pending remote one will not be attempted due to it being
|
|
||||||
// uneconomical since it was not used for CPFP.
|
|
||||||
// The anchor from the pending remote may or may not appear, which is a
|
|
||||||
// bug found only in macOS - when updating the commitments, the channel
|
|
||||||
// state machine somehow thinks we still have a pending remote
|
|
||||||
// commitment, causing it to sweep the anchor from that version.
|
|
||||||
//
|
|
||||||
// TODO(yy): fix the above bug in the channel state machine.
|
|
||||||
if !isDarwin() {
|
|
||||||
ht.AssertNumPendingSweeps(carol, numSweeps)
|
|
||||||
}
|
|
||||||
|
|
||||||
// We should see two txns in the mempool, we now a block to confirm,
|
// We should see two txns in the mempool, we now a block to confirm,
|
||||||
// - Carol's force close tx.
|
// - Carol's force close tx.
|
||||||
@ -2620,22 +2575,7 @@ func runLocalPreimageClaimLeased(ht *lntest.HarnessTest,
|
|||||||
numSweeps = 2
|
numSweeps = 2
|
||||||
}
|
}
|
||||||
|
|
||||||
// When running in macOS, we might see three anchor sweeps - one from
|
flakeSkipPendingSweepsCheckDarwin(ht, carol, numSweeps)
|
||||||
// the local, one from the remote, and one from the pending remote:
|
|
||||||
// - the local one will be swept.
|
|
||||||
// - the remote one will be marked as failed due to `testmempoolaccept`
|
|
||||||
// check.
|
|
||||||
// - the pending remote one will not be attempted due to it being
|
|
||||||
// uneconomical since it was not used for CPFP.
|
|
||||||
// The anchor from the pending remote may or may not appear, which is a
|
|
||||||
// bug found only in macOS - when updating the commitments, the channel
|
|
||||||
// state machine somehow thinks we still have a pending remote
|
|
||||||
// commitment, causing it to sweep the anchor from that version.
|
|
||||||
//
|
|
||||||
// TODO(yy): fix the above bug in the channel state machine.
|
|
||||||
if !isDarwin() {
|
|
||||||
ht.AssertNumPendingSweeps(carol, numSweeps)
|
|
||||||
}
|
|
||||||
|
|
||||||
// We should see two txns in the mempool, we now a block to confirm,
|
// We should see two txns in the mempool, we now a block to confirm,
|
||||||
// - Carol's force close tx.
|
// - Carol's force close tx.
|
||||||
@ -3043,22 +2983,7 @@ func runHtlcAggregation(ht *lntest.HarnessTest,
|
|||||||
numSweeps = 2
|
numSweeps = 2
|
||||||
}
|
}
|
||||||
|
|
||||||
// When running in macOS, we might see three anchor sweeps - one from
|
flakeSkipPendingSweepsCheckDarwin(ht, bob, numSweeps)
|
||||||
// the local, one from the remote, and one from the pending remote:
|
|
||||||
// - the local one will be swept.
|
|
||||||
// - the remote one will be marked as failed due to `testmempoolaccept`
|
|
||||||
// check.
|
|
||||||
// - the pending remote one will not be attempted due to it being
|
|
||||||
// uneconomical since it was not used for CPFP.
|
|
||||||
// The anchor from the pending remote may or may not appear, which is a
|
|
||||||
// bug found only in macOS - when updating the commitments, the channel
|
|
||||||
// state machine somehow thinks we still have a pending remote
|
|
||||||
// commitment, causing it to sweep the anchor from that version.
|
|
||||||
//
|
|
||||||
// TODO(yy): fix the above bug in the channel state machine.
|
|
||||||
if !isDarwin() {
|
|
||||||
ht.AssertNumPendingSweeps(bob, numSweeps)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Bob's force close tx and anchor sweeping tx should now be found in
|
// Bob's force close tx and anchor sweeping tx should now be found in
|
||||||
// the mempool.
|
// the mempool.
|
||||||
|
@ -254,11 +254,6 @@ func getLndBinary(t *testing.T) string {
|
|||||||
return binary
|
return binary
|
||||||
}
|
}
|
||||||
|
|
||||||
// isDarwin returns true if the test is running on a macOS.
|
|
||||||
func isDarwin() bool {
|
|
||||||
return runtime.GOOS == "darwin"
|
|
||||||
}
|
|
||||||
|
|
||||||
// isWindowsOS returns true if the test is running on a Windows OS.
|
// isWindowsOS returns true if the test is running on a Windows OS.
|
||||||
func isWindowsOS() bool {
|
func isWindowsOS() bool {
|
||||||
return runtime.GOOS == "windows"
|
return runtime.GOOS == "windows"
|
||||||
|
Reference in New Issue
Block a user