Skip to content

Commit

Permalink
Merge pull request #77 from rustyrussell/mascros/close_connection
Browse files Browse the repository at this point in the history
fix: add Wait event to allow to slow down lnptototest
  • Loading branch information
vincenzopalazzo authored Mar 12, 2023
2 parents 31388d9 + 403444c commit 928d196
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 8 additions & 1 deletion lnprototest/clightning/clightning.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import shutil
import logging
import socket
import time

from contextlib import closing
from datetime import date
Expand Down Expand Up @@ -214,7 +215,7 @@ def restart(self) -> None:
self.bitcoind.restart()
self.start(also_bitcoind=False)

def connect(self, event: Event, connprivkey: str) -> None:
def connect(self, _: Event, connprivkey: str) -> None:
self.add_conn(CLightningConn(connprivkey, self.lightning_port))

def getblockheight(self) -> int:
Expand Down Expand Up @@ -318,6 +319,12 @@ def _done(fut: Any) -> None:
self.is_fundchannel_kill = False
self.cleanup_callbacks.remove(self.kill_fundchannel)

# FIXME core lightning has a race condition
# when the core lightning node will go to fund the channel
# but it will go to to connect with the node before
# This required some more analysis from core lightning side
time.sleep(1)

fut = self.executor.submit(
_fundchannel, self, conn, amount, feerate, expect_fail
)
Expand Down
4 changes: 0 additions & 4 deletions tests/test_bolt2-01-open_channel.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Variations on open_channel, accepter + opener perspectives
import pytest
from lnprototest import (
TryAll,
Block,
Expand Down Expand Up @@ -168,9 +167,6 @@ def test_open_channel_from_accepter_side(runner: Runner) -> None:
run_runner(runner, merge_events_sequences(connections_events, test_events))


@pytest.mark.skip(
reason="skip this test because the when we try to connect to lnprototest the connection fails"
)
def test_open_channel_opener_side(runner: Runner) -> None:
local_funding_privkey = "20"
local_keyset = gen_random_keyset(int(local_funding_privkey))
Expand Down

0 comments on commit 928d196

Please sign in to comment.