Skip to content

Commit 91687d6

Browse files
committed
patch enable-offline-test.patch
1 parent 5b01dd4 commit 91687d6

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

tests/test_connection.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4523,15 +4523,24 @@ def test_reconnect_no_additional_transient_failure(node_factory, bitcoind):
45234523
assert not l1.daemon.is_in_log(f"{l2id}-chan#1: Peer transient failure in CHANNELD_NORMAL: Disconnected", start=offset1)
45244524

45254525

4526-
@pytest.mark.xfail(strict=True)
45274526
def test_offline(node_factory):
45284527
# if get_node starts it, it'll expect an address, so do it manually.
45294528
l1 = node_factory.get_node(options={"offline": None}, start=False)
45304529
l1.daemon.start()
45314530

4532-
# we expect it to log offline mode an not to create any listener
4531+
# we expect it to log offline mode not to listen.
45334532
assert l1.daemon.is_in_log("Started in offline mode!")
4534-
assert not l1.daemon.is_in_log("connectd: Created listener on")
4533+
line = l1.daemon.is_in_log("connectd: Created listener on")
4534+
port = re.search(r'connectd: Created listener on 127.0.0.1:(.*)', line).groups()[0]
4535+
4536+
l2 = node_factory.get_node()
4537+
4538+
# We cannot connect in!
4539+
with pytest.raises(RpcError, match=f"All addresses failed: 127.0.0.1:{port}: Connection establishment: Connection refused."):
4540+
l2.rpc.connect(l1.rpc.getinfo()['id'], 'localhost', int(port))
4541+
4542+
# We *can* connect out
4543+
l1.rpc.connect(l2.info['id'], 'localhost', l2.port)
45354544

45364545

45374546
def test_last_stable_connection(node_factory):

0 commit comments

Comments
 (0)