mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
pytest: Stabilize test_channel_{spendable,receivable}
They were using TIMEOUT / 2 which may be way too long (hit against test timeout), so we use a still ludicrous 30 seconds instead.
This commit is contained in:
committed by
Rusty Russell
parent
6384cadd69
commit
8cc62d76e4
@@ -2233,7 +2233,7 @@ def test_channel_spendable(node_factory, bitcoind):
|
|||||||
"""Test that spendable_msat is accurate"""
|
"""Test that spendable_msat is accurate"""
|
||||||
sats = 10**6
|
sats = 10**6
|
||||||
l1, l2 = node_factory.line_graph(2, fundamount=sats, wait_for_announce=True,
|
l1, l2 = node_factory.line_graph(2, fundamount=sats, wait_for_announce=True,
|
||||||
opts={'plugin': os.path.join(os.getcwd(), 'tests/plugins/hold_invoice.py'), 'holdtime': str(TIMEOUT / 2)})
|
opts={'plugin': os.path.join(os.getcwd(), 'tests/plugins/hold_invoice.py'), 'holdtime': '30'})
|
||||||
|
|
||||||
payment_hash = l2.rpc.invoice('any', 'inv', 'for testing')['payment_hash']
|
payment_hash = l2.rpc.invoice('any', 'inv', 'for testing')['payment_hash']
|
||||||
|
|
||||||
@@ -2286,7 +2286,7 @@ def test_channel_receivable(node_factory, bitcoind):
|
|||||||
"""Test that receivable_msat is accurate"""
|
"""Test that receivable_msat is accurate"""
|
||||||
sats = 10**6
|
sats = 10**6
|
||||||
l1, l2 = node_factory.line_graph(2, fundamount=sats, wait_for_announce=True,
|
l1, l2 = node_factory.line_graph(2, fundamount=sats, wait_for_announce=True,
|
||||||
opts={'plugin': os.path.join(os.getcwd(), 'tests/plugins/hold_invoice.py'), 'holdtime': str(TIMEOUT / 2)})
|
opts={'plugin': os.path.join(os.getcwd(), 'tests/plugins/hold_invoice.py'), 'holdtime': '30'})
|
||||||
|
|
||||||
payment_hash = l2.rpc.invoice('any', 'inv', 'for testing')['payment_hash']
|
payment_hash = l2.rpc.invoice('any', 'inv', 'for testing')['payment_hash']
|
||||||
|
|
||||||
@@ -2339,8 +2339,15 @@ def test_channel_spendable_large(node_factory, bitcoind):
|
|||||||
"""Test that spendable_msat is accurate for large channels"""
|
"""Test that spendable_msat is accurate for large channels"""
|
||||||
# This is almost the max allowable spend.
|
# This is almost the max allowable spend.
|
||||||
sats = 4294967
|
sats = 4294967
|
||||||
l1, l2 = node_factory.line_graph(2, fundamount=sats, wait_for_announce=True,
|
l1, l2 = node_factory.line_graph(
|
||||||
opts={'plugin': os.path.join(os.getcwd(), 'tests/plugins/hold_invoice.py'), 'holdtime': str(TIMEOUT / 2)})
|
2,
|
||||||
|
fundamount=sats,
|
||||||
|
wait_for_announce=True,
|
||||||
|
opts={
|
||||||
|
'plugin': os.path.join(os.getcwd(), 'tests/plugins/hold_invoice.py'),
|
||||||
|
'holdtime': '30'
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
payment_hash = l2.rpc.invoice('any', 'inv', 'for testing')['payment_hash']
|
payment_hash = l2.rpc.invoice('any', 'inv', 'for testing')['payment_hash']
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user