1
0
mirror of https://github.com/ACINQ/eclair.git synced 2024-11-19 09:54:02 +01:00

Fix NodeRelayer flaky test (#1588)

This test was randomly failing because of a race condition: we sometimes
sent the payment failure before the payment FSM asked for routes, so it
was ignored and the test could not progress.
This commit is contained in:
Bastien Teinturier 2020-11-06 11:20:22 +01:00 committed by GitHub
parent 59449bfcfc
commit c0d465c409
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -295,6 +295,7 @@ class NodeRelayerSpec extends ScalaTestWithActorTestKit(ConfigFactory.load("appl
incoming.foreach(p => nodeRelayer ! NodeRelay.Relay(p))
val payFSM = mockPayFSM.expectMessageType[akka.actor.ActorRef]
router.expectMessageType[RouteRequest]
payFSM ! Status.Failure(BalanceTooLow)
incoming.foreach { p =>
@ -313,6 +314,7 @@ class NodeRelayerSpec extends ScalaTestWithActorTestKit(ConfigFactory.load("appl
incomingMultiPart.foreach(p => nodeRelayer ! NodeRelay.Relay(p))
val payFSM = mockPayFSM.expectMessageType[akka.actor.ActorRef]
router.expectMessageType[RouteRequest]
// If we're having a hard time finding routes, raising the fee/cltv will likely help.
val failures = LocalFailure(Nil, RouteNotFound) :: RemoteFailure(Nil, Sphinx.DecryptedFailurePacket(outgoingNodeId, PermanentNodeFailure)) :: LocalFailure(Nil, RouteNotFound) :: Nil
@ -334,6 +336,7 @@ class NodeRelayerSpec extends ScalaTestWithActorTestKit(ConfigFactory.load("appl
incomingMultiPart.foreach(p => nodeRelayer ! NodeRelay.Relay(p))
val payFSM = mockPayFSM.expectMessageType[akka.actor.ActorRef]
router.expectMessageType[RouteRequest]
val failures = RemoteFailure(Nil, Sphinx.DecryptedFailurePacket(outgoingNodeId, FinalIncorrectHtlcAmount(42 msat))) :: UnreadableRemoteFailure(Nil) :: Nil
payFSM ! PaymentFailed(relayId, incomingMultiPart.head.add.paymentHash, failures)