Skip to content

Commit fe94c3b

Browse files
committed
loopout: fix flaky loopout preimage push and expiry tests
1 parent 796d036 commit fe94c3b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

loopout_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,11 @@ func testPreimagePush(t *testing.T) {
572572
// preimage is not revealed, we also do not expect a preimage push.
573573
expiryChan <- testTime
574574

575+
// Since we don't have a reliable mechanism to non-intursively avoid
576+
// races by setting the fee estimate too soon, let's sleep here a bit
577+
// to ensure the first sweep fails.
578+
time.Sleep(500 * time.Millisecond)
579+
575580
// Now we decrease our fees for the swap's confirmation target to less
576581
// than the maximum miner fee.
577582
ctx.Lnd.SetFeeEstimate(testReq.SweepConfTarget, chainfee.SatPerKWeight(
@@ -751,6 +756,11 @@ func testExpiryBeforeReveal(t *testing.T) {
751756
// won't attempt a sweep at this point.
752757
expiryChan <- testTime
753758

759+
// Since we don't have a reliable mechanism to non-intursively avoid
760+
// races by setting the fee estimate too soon, let's sleep here a bit
761+
// to ensure the first sweep fails.
762+
time.Sleep(500 * time.Millisecond)
763+
754764
// Now we decrease our conf target to less than our max miner fee.
755765
lnd.SetFeeEstimate(testReq.SweepConfTarget, chainfee.SatPerKWeight(
756766
testReq.MaxMinerFee/2,

0 commit comments

Comments
 (0)