Skip to content

Commit 725c417

Browse files
committed
pytest: add debug print to diagnose flake in test_peer_anchor_push
Sometimes the feerate is 5 too high. But without seeing the actual txs it's looking at, it's hard to know why. ``` actual_feerate = 13005.66942869603, expected_feerate = 13000 def check_feerate(nodes, actual_feerate, expected_feerate): # Feerate can't be lower. assert actual_feerate > expected_feerate - 2 if actual_feerate >= expected_feerate + 2: if any([did_short_sig(n) for n in nodes]): return # Use assert as it shows the actual values on failure > assert actual_feerate < expected_feerate + 2 E AssertionError ``` Signed-off-by: Rusty Russell <[email protected]>
1 parent 1b89ea6 commit 725c417

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tests/test_closing.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4056,6 +4056,7 @@ def test_peer_anchor_push(node_factory, bitcoind, executor, chainparams):
40564056
l2.daemon.wait_for_log("sendrawtx exit 0")
40574057
# Check feerate for entire package (commitment tx + anchor) is ~ correct
40584058
details = bitcoind.rpc.getrawmempool(True).values()
4059+
print(f"mempool = {details}")
40594060
total_weight = sum([d['weight'] for d in details])
40604061
total_fees = sum([float(d['fees']['base']) * 100_000_000 for d in details])
40614062
total_feerate_perkw = total_fees / total_weight * 1000

0 commit comments

Comments
 (0)