pytest: wait until mock is called for set_feerates.

Got a spurious failure in test_no_fee_estimate; we fired too soon from the logs (presumably
we raced in on the first response, but estimatesmartfee gets called 3 times).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2018-09-20 13:52:15 +09:30
committed by Christian Decker
parent d5c3626fa7
commit e41e1a177e
2 changed files with 7 additions and 1 deletions

View File

@@ -627,8 +627,10 @@ class LightningNode(object):
}
self.daemon.rpcproxy.mock_rpc('estimatesmartfee', mock_estimatesmartfee)
# Technically, this waits until it's called, not until it's processed.
# We wait until all three levels have been called.
if wait_for_effect:
self.daemon.wait_for_log('Feerate estimate for .* set to')
wait_for(lambda: self.daemon.rpcproxy.mock_counts['estimatesmartfee'] >= 3)
class NodeFactory(object):