Skip to content

Commit

Permalink
Fix minimal node fixture flakyness (#2302)
Browse files Browse the repository at this point in the history
There was a race condition between the `wait_for_funding_locked` state
and the `normal` state.
  • Loading branch information
t-bast authored Jun 8, 2022
1 parent 340b568 commit 682e9bf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import org.scalatest.TestData
import org.scalatest.concurrent.IntegrationPatience
import scodec.bits.HexStringSyntax


/**
* This test checks the integration between Channel and Router (events, etc.)
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import fr.acinq.eclair.router.Router
import fr.acinq.eclair.wire.protocol.IPAddress
import fr.acinq.eclair.{BlockHeight, MilliSatoshi, MilliSatoshiLong, NodeParams, ShortChannelId, TestBitcoinCoreClient, TestDatabases, TestFeeEstimator}
import org.scalatest.Assertions
import org.scalatest.concurrent.Eventually.eventually

import java.net.InetAddress
import java.util.UUID
Expand Down Expand Up @@ -162,8 +163,10 @@ object MinimalNodeFixture extends Assertions {
watch1.replyTo ! WatchFundingConfirmedTriggered(blockHeight, txIndex, fundingTx)
watch2.replyTo ! WatchFundingConfirmedTriggered(blockHeight, txIndex, fundingTx)

waitReady(node1, channelId)
waitReady(node2, channelId)
eventually {
assert(getChannelState(node1, channelId) == NORMAL)
assert(getChannelState(node2, channelId) == NORMAL)
}

val data1After = getChannelData(node1, channelId).asInstanceOf[DATA_NORMAL]
val data2After = getChannelData(node2, channelId).asInstanceOf[DATA_NORMAL]
Expand Down

0 comments on commit 682e9bf

Please sign in to comment.