noise: Disabled retry test for being way too flaky

This commit is contained in:
Christian Decker
2020-05-15 17:39:33 +02:00
parent 9b5a9076d4
commit 8668a2244d

View File

@@ -1,10 +1,12 @@
from binascii import hexlify from binascii import hexlify
from onion import TlvPayload from onion import TlvPayload
from flaky import flaky
from pprint import pprint from pprint import pprint
from pyln.client import RpcError from pyln.client import RpcError
from pyln.testing.fixtures import * from pyln.testing.fixtures import *
from pyln.testing.utils import wait_for from pyln.testing.utils import wait_for
import hashlib import hashlib
import unittest
import zbase32 import zbase32
@@ -30,7 +32,25 @@ def test_sendmsg_success(node_factory, executor):
assert(m2['verified'] == True) assert(m2['verified'] == True)
@unittest.skipIf(True, "This test is flaky since we cannot force a payment to take a specific route")
def test_sendmsg_retry(node_factory, executor): def test_sendmsg_retry(node_factory, executor):
"""Fail a sendmsg using a cheap route, and check that it retries.
```dot
digraph {
l1 -> l2;
l2 -> l3;
l3 -> l4 [label = "fee-base=100'000"];
l2 -> l5;
l5 -> l4 [label = "fee-base=normal"];
}
```
By having a huge fee on the l3 -> l4 edge we force the initial attempt to
go through l1 -> l2 -> l5 -> l4, which should fail since l5 is offline (l1
should still be unaware about this).
"""
opts = [{'plugin': plugin}, {}, {'fee-base': 10000}, {'plugin': plugin}] opts = [{'plugin': plugin}, {}, {'fee-base': 10000}, {'plugin': plugin}]
l1, l2, l3, l4 = node_factory.line_graph(4, opts=opts) l1, l2, l3, l4 = node_factory.line_graph(4, opts=opts)
l5 = node_factory.get_node() l5 = node_factory.get_node()
@@ -44,21 +64,23 @@ def test_sendmsg_retry(node_factory, executor):
return False return False
return True return True
wait_for(lambda: gossip_synced([l1, l2, l3, l4, l5])) wait_for(lambda: [c['active'] for c in l1.rpc.listchannels()['channels']] == [True]*10)
# Now stop l5 so the first attempt will fail. # Now stop l5 so the first attempt will fail.
l5.stop() l5.stop()
recv = executor.submit(l4.rpc.recvmsg) recv = executor.submit(l4.rpc.recvmsg)
send = executor.submit(l1.rpc.sendmsg, l4.info['id'], "Hello world!") send = executor.submit(l1.rpc.sendmsg, l4.info['id'], "Hello world!")
# Just making sure our view didn't change since we initiated the attempt
assert([c['active'] for c in l1.rpc.listchannels()['channels']] == [True]*10)
pprint(l1.rpc.listchannels())
l1.daemon.wait_for_log(r'Retrying delivery') l1.daemon.wait_for_log(r'Retrying delivery')
sres = send.result(10) sres = send.result(10)
assert(sres['attempt'] == 2) assert(sres['attempt'] == 2)
pprint(sres) pprint(sres)
print(recv.result(10))
msg = l4.rpc.recvmsg(last_id=-1) msg = l4.rpc.recvmsg(last_id=-1)