Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a flaky async payment triggerer test #2764

Merged
merged 1 commit into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ object PeerReadyNotifier {
context.log.debug("waiting for peer to connect at block {}", currentBlockHeight)
Behaviors.same
case Timeout =>
context.log.info("timed out waiting for peer to be ready")
context.log.info("timed out waiting for peer to connect")
replyTo ! PeerUnavailable(remoteNodeId)
Behaviors.stopped
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,6 @@ class AsyncPaymentTriggererSpec extends ScalaTestWithActorTestKit(ConfigFactory.
system.eventStream ! EventStream.Publish(CurrentBlockHeight(BlockHeight(100)))
probe.expectMessage(AsyncPaymentTimeout)

// First remote node connects, but does not trigger expired watch
system.eventStream ! EventStream.Publish(PeerConnected(peer.ref.toClassic, remoteNodeId, null))

// Second remote node connects and triggers watch
system.eventStream ! EventStream.Publish(PeerConnected(peer.ref.toClassic, remoteNodeId2, null))
val request3 = switchboard.expectMessageType[Switchboard.GetPeerInfo]
Expand All @@ -187,6 +184,10 @@ class AsyncPaymentTriggererSpec extends ScalaTestWithActorTestKit(ConfigFactory.
peer.expectMessageType[Peer.GetPeerChannels].replyTo ! Peer.PeerChannels(remoteNodeId, Seq(Peer.ChannelInfo(null, NEGOTIATING, null)))
probe.expectNoMessage(100 millis)
probe2.expectMessage(AsyncPaymentTriggered)

// First remote node connects, but does not trigger expired watch
system.eventStream ! EventStream.Publish(PeerConnected(peer.ref.toClassic, remoteNodeId, null))
switchboard.expectNoMessage(100 millis)
}

test("triggerer treats an unexpected stop of the notifier as a cancel") { f =>
Expand Down