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 flakes #13 #8073

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -369,17 +369,15 @@ include doc/Makefile
include contrib/msggen/Makefile
include devtools/Makefile
include tools/Makefile
ifneq ($(RUST),0)
include cln-rpc/Makefile
endif
include plugins/Makefile
include tests/plugins/Makefile

ifneq ($(FUZZING),0)
include tests/fuzz/Makefile
endif
ifneq ($(RUST),0)
include cln-rpc/Makefile
include plugins/rest-plugin/Makefile
endif
include cln-grpc/Makefile

ifneq ($V,1)
MSGGEN_ARGS := -s
Expand Down
3 changes: 2 additions & 1 deletion contrib/msggen/msggen/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -25517,6 +25517,7 @@
"perkw": 3750,
"perkb": 15000
},
"owner": "onchaind",
"direction": 0,
"channel_id": "channelid1100011000110001100011000110001100011000110001100011000",
"funding_txid": "channeltxid01050000500005000050000500005000050000500005000050000",
Expand Down Expand Up @@ -25619,7 +25620,7 @@
"status": [
"CLOSINGD_SIGEXCHANGE:We agreed on a closing fee of 2250 satoshi for tx:scratchid2030303030303030303030303030303030303030303030303030303",
"ONCHAIN:Tracking mutual close transaction",
"ONCHAIN:All outputs resolved: waiting 99 more blocks before forgetting channel"
"ONCHAIN:All outputs resolved: waiting 96 more blocks before forgetting channel"
],
"in_payments_offered": 0,
"in_offered_msat": 0,
Expand Down
4 changes: 2 additions & 2 deletions contrib/plugins/fail/failtimeout.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@


def json_getmanifest(request, **kwargs):
# Timeout is 60 seconds, so wait more
time.sleep(61)
# Timeout is 120 seconds, so wait more
time.sleep(121)
return {
"options": [
],
Expand Down
8 changes: 4 additions & 4 deletions contrib/startup_regtest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,8 @@ fund_nodes() {

"$LCLI" -H --lightning-dir="$LIGHTNING_DIR"/l"$node1" connect "$L2_NODE_ID"@localhost:"$L2_NODE_PORT" > /dev/null

L1_WALLET_ADDR=$($LCLI -F --lightning-dir=$LIGHTNING_DIR/l"$node1" newaddr | sed -n 's/^bech32=\(.*\)/\1/p')
L2_WALLET_ADDR=$($LCLI -F --lightning-dir=$LIGHTNING_DIR/l"$node2" newaddr | sed -n 's/^bech32=\(.*\)/\1/p')
L1_WALLET_ADDR=$($LCLI -F --lightning-dir="$LIGHTNING_DIR"/l"$node1" newaddr | sed -n 's/^bech32=\(.*\)/\1/p')
L2_WALLET_ADDR=$($LCLI -F --lightning-dir="$LIGHTNING_DIR"/l"$node2" newaddr | sed -n 's/^bech32=\(.*\)/\1/p')

ensure_bitcoind_funds

Expand Down Expand Up @@ -383,7 +383,7 @@ fund_nodes() {

printf "%s" "Waiting for confirmation... "

while ! "$LCLI" -F --lightning-dir=$LIGHTNING_DIR/l"$node1" listchannels | grep -q "channels"
while ! "$LCLI" -F --lightning-dir="$LIGHTNING_DIR"/l"$node1" listchannels | grep -q "channels"
do
sleep 1
done
Expand Down Expand Up @@ -428,7 +428,7 @@ node_info() {
}

destroy_ln() {
rm -rf $LIGHTNING_DIR/l[0-9]*
rm -rf "$LIGHTNING_DIR"/l[0-9]*
}

start_elem() {
Expand Down
3 changes: 2 additions & 1 deletion doc/schemas/lightning-listpeerchannels.json
Original file line number Diff line number Diff line change
Expand Up @@ -1699,6 +1699,7 @@
"perkw": 3750,
"perkb": 15000
},
"owner": "onchaind",
"direction": 0,
"channel_id": "channelid1100011000110001100011000110001100011000110001100011000",
"funding_txid": "channeltxid01050000500005000050000500005000050000500005000050000",
Expand Down Expand Up @@ -1801,7 +1802,7 @@
"status": [
"CLOSINGD_SIGEXCHANGE:We agreed on a closing fee of 2250 satoshi for tx:scratchid2030303030303030303030303030303030303030303030303030303",
"ONCHAIN:Tracking mutual close transaction",
"ONCHAIN:All outputs resolved: waiting 99 more blocks before forgetting channel"
"ONCHAIN:All outputs resolved: waiting 96 more blocks before forgetting channel"
],
"in_payments_offered": 0,
"in_offered_msat": 0,
Expand Down
1 change: 1 addition & 0 deletions plugins/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ target/${RUST_PROFILE}/clnrest: ${CLN_REST_PLUGIN_SRC}
cargo build ${CARGO_OPTS} --bin clnrest

ifneq ($(RUST),0)
include plugins/rest-plugin/Makefile
DEFAULT_TARGETS += $(CLN_PLUGIN_EXAMPLES) plugins/cln-grpc plugins/clnrest
endif

Expand Down
12 changes: 6 additions & 6 deletions tests/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def test_plugin_dir(node_factory):

def test_plugin_slowinit(node_factory):
"""Tests that the 'plugin' RPC command times out if plugin doesnt respond"""
os.environ['SLOWINIT_TIME'] = '61'
os.environ['SLOWINIT_TIME'] = '121'
n = node_factory.get_node()

with pytest.raises(RpcError, match=': timed out before replying to init'):
Expand Down Expand Up @@ -3263,7 +3263,7 @@ def test_autoclean(node_factory):
# Now enable: they will get autocleaned
l3.rpc.setconfig('autoclean-expiredinvoices-age', 2)
wait_for(lambda: len(l3.rpc.listinvoices()['invoices']) == 2)
assert l3.rpc.autoclean_status()['autoclean']['expiredinvoices']['cleaned'] == 3
wait_for(lambda: l3.rpc.autoclean_status()['autoclean']['expiredinvoices']['cleaned'] == 3)

# Reconnect, l1 pays invoice, we test paid expiry.
l2.rpc.connect(l3.info['id'], 'localhost', l3.port)
Expand All @@ -3281,15 +3281,15 @@ def test_autoclean(node_factory):

wait_for(lambda: l3.rpc.listinvoices()['invoices'] == [])
assert l3.rpc.autoclean_status()['autoclean']['expiredinvoices']['cleaned'] == 3
assert l3.rpc.autoclean_status()['autoclean']['paidinvoices']['cleaned'] == 1
wait_for(lambda: l3.rpc.autoclean_status()['autoclean']['paidinvoices']['cleaned'] == 1)

assert only_one(l1.rpc.listpays(inv5['bolt11'])['pays'])['status'] == 'failed'
assert only_one(l1.rpc.listpays(inv4['bolt11'])['pays'])['status'] == 'complete'
l1.rpc.setconfig('autoclean-failedpays-age', 1)
l1.rpc.setconfig('autoclean-cycle', 5)

wait_for(lambda: l1.rpc.listpays(inv5['bolt11'])['pays'] == [])
assert l1.rpc.autoclean_status()['autoclean']['failedpays']['cleaned'] == 1
wait_for(lambda: l1.rpc.autoclean_status()['autoclean']['failedpays']['cleaned'] == 1)
assert l1.rpc.autoclean_status()['autoclean']['succeededpays']['cleaned'] == 0

l1.rpc.setconfig('autoclean-succeededpays-age', 2)
Expand All @@ -3307,7 +3307,7 @@ def test_autoclean(node_factory):
wait_for(lambda: l2.rpc.listforwards(status='failed')['forwards'] == [])

assert len(l2.rpc.listforwards(status='settled')['forwards']) == 1
assert l2.rpc.autoclean_status()['autoclean']['failedforwards']['cleaned'] == 1
wait_for(lambda: l2.rpc.autoclean_status()['autoclean']['failedforwards']['cleaned'] == 1)
assert l2.rpc.autoclean_status()['autoclean']['succeededforwards']['cleaned'] == 0

amt_before = l2.rpc.getinfo()['fees_collected_msat']
Expand All @@ -3317,7 +3317,7 @@ def test_autoclean(node_factory):
wait_for(lambda: l2.rpc.listforwards(status='settled')['forwards'] == [])
assert l2.rpc.listforwards() == {'forwards': []}
assert l2.rpc.autoclean_status()['autoclean']['failedforwards']['cleaned'] == 1
assert l2.rpc.autoclean_status()['autoclean']['succeededforwards']['cleaned'] == 1
wait_for(lambda: l2.rpc.autoclean_status()['autoclean']['succeededforwards']['cleaned'] == 1)

# We still see correct total in getinfo!
assert l2.rpc.getinfo()['fees_collected_msat'] == amt_before
Expand Down
Loading