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

Conversation

remyers
Copy link
Contributor

@remyers remyers commented Oct 10, 2023

Sometimes the PeerReadyNotifier for node A has not been killed before node A connects. This causes an extra GetPeerInfo message to be sent to the switchboard and the assert(request3.remoteNodeId == remoteNodeId2) check to fail when the GetPeerInfo for node A comes before the one for node B. Just waiting to receive the AsyncPaymentTimeout message does not guarantee the notifier has been stopped.

If node A connects after node B then this race does not occur.

In the logs the error looked like this:

watch two nodes, one connects and the other times out *** FAILED ***
 02aaaa00ce2f18a967dc4f25f414e671ba6585f8ef0b8c5fb812c21064f55a2eaa did not equal 02bbbb671d15145722fb8c28d732cddb249bcc6652ed2b297ff1f77a18371b1e63 (AsyncPaymentTriggererSpec.scala:185)
 Analysis:
 Crypto$PublicKey(pub: 02aaaa00ce2f18a967dc4f25f414e671ba6585f8ef0b8c5fb812c21064f55a2eaa -> 02bbbb671d15145722fb8c28d732cddb249bcc6652ed2b297ff1f77a18371b1e63, value: ByteVector$Chunk(bytes: ByteVector$View(at: scodec.bits.ByteVector$AtArray@414cba29 -> scodec.bits.ByteVector$AtArray@317a0b5e)))

Sometimes the notifier for node A has not been killed before node A connects. This causes an extra GetPeerInfo message to be sent to the switchboard and the `assert(request3.remoteNodeId == remoteNodeId2)` check to fail when the GetPeerInfo for node A comes first. Just waiting to receive the `AsyncPaymentTimeout` message is not enough.

If node A connects after node B then this race does not occur.
@codecov-commenter
Copy link

Codecov Report

Merging #2764 (8bf4761) into master (9ca9227) will increase coverage by 0.03%.
Report is 1 commits behind head on master.
The diff coverage is 100.00%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

@@            Coverage Diff             @@
##           master    #2764      +/-   ##
==========================================
+ Coverage   85.84%   85.87%   +0.03%     
==========================================
  Files         216      216              
  Lines       18102    18093       -9     
  Branches      762      755       -7     
==========================================
- Hits        15540    15538       -2     
+ Misses       2562     2555       -7     
Files Coverage Δ
...re/src/main/scala/fr/acinq/eclair/NodeParams.scala 93.39% <100.00%> (-0.03%) ⬇️
...n/scala/fr/acinq/eclair/io/PeerReadyNotifier.scala 69.23% <100.00%> (ø)
...cinq/eclair/remote/EclairInternalsSerializer.scala 97.82% <100.00%> (ø)
...scala/fr/acinq/eclair/router/BalanceEstimate.scala 98.93% <100.00%> (ø)
.../src/main/scala/fr/acinq/eclair/router/Graph.scala 97.25% <100.00%> (-0.09%) ⬇️
...cala/fr/acinq/eclair/router/RouteCalculation.scala 94.56% <100.00%> (ø)
...src/main/scala/fr/acinq/eclair/router/Router.scala 94.78% <100.00%> (ø)
...main/scala/fr/acinq/eclair/router/Validation.scala 95.00% <100.00%> (ø)

... and 7 files with indirect coverage changes

@t-bast t-bast merged commit 2879a54 into ACINQ:master Oct 30, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants