MCPcopy Create free account
hub / github.com/ElementsProject/lightning / wait_for

Function wait_for

contrib/pyln-testing/pyln/testing/utils.py:87–97  ·  view source on GitHub ↗
(success, timeout=TIMEOUT)

Source from the content-addressed store, hash-verified

85
86
87def wait_for(success, timeout=TIMEOUT):
88 start_time = time.time()
89 interval = 0.25
90 while not success():
91 time_left = start_time + timeout - time.time()
92 if time_left <= 0:
93 raise ValueError("Timeout while waiting for {}", success)
94 time.sleep(min(interval, time_left))
95 interval *= 2
96 if interval > 5:
97 interval = 5
98
99
100def write_config(filename, opts, regtest_opts=None, section_name='regtest'):

Callers 15

test_disconnect_openerFunction · 0.90
test_remote_disconnectFunction · 0.90
test_disconnect_fundeeFunction · 0.90
test_reconnect_gossipingFunction · 0.90
test_funding_failFunction · 0.90
test_funding_toolargeFunction · 0.90
test_v2_openFunction · 0.90

Calls 1

successFunction · 0.50

Tested by 15

test_disconnect_openerFunction · 0.72
test_remote_disconnectFunction · 0.72
test_disconnect_fundeeFunction · 0.72
test_reconnect_gossipingFunction · 0.72
test_funding_failFunction · 0.72
test_funding_toolargeFunction · 0.72
test_v2_openFunction · 0.72