Gradually bump mocktime in wait_for_quorum_connections (#3388)

* Gradually bump mocktime in wait_for_quorum_connections

* Lower nLLMQConnectionRetryTimeout to 1 sec for regtest
This commit is contained in:
UdjinM6 2020-03-31 08:06:41 +03:00 committed by GitHub
parent 3b904a0fa1
commit f43cdbc586
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -840,7 +840,7 @@ public:
fMineBlocksOnDemand = true; fMineBlocksOnDemand = true;
fAllowMultipleAddressesFromGroup = true; fAllowMultipleAddressesFromGroup = true;
fAllowMultiplePorts = true; fAllowMultiplePorts = true;
nLLMQConnectionRetryTimeout = 30; // must be lower then the LLMQ signing session timeout so that tests have control over failing behavior nLLMQConnectionRetryTimeout = 1; // must be lower then the LLMQ signing session timeout so that tests have control over failing behavior
nFulfilledRequestExpireTime = 5*60; // fulfilled requests expire in 5 minutes nFulfilledRequestExpireTime = 5*60; // fulfilled requests expire in 5 minutes
nPoolMinParticipants = 2; nPoolMinParticipants = 2;

View File

@ -771,7 +771,7 @@ class DashTestFramework(BitcoinTestFramework):
return all(node.spork('show') == sporks for node in self.nodes[1:]) return all(node.spork('show') == sporks for node in self.nodes[1:])
wait_until(check_sporks_same, timeout=timeout, sleep=0.5) wait_until(check_sporks_same, timeout=timeout, sleep=0.5)
def wait_for_quorum_connections(self, expected_connections=2, timeout = 30, wait_proc=None): def wait_for_quorum_connections(self, expected_connections=2, timeout = 60, wait_proc=None):
def check_quorum_connections(): def check_quorum_connections():
all_ok = True all_ok = True
for node in self.nodes: for node in self.nodes:
@ -795,7 +795,7 @@ class DashTestFramework(BitcoinTestFramework):
if not all_ok and wait_proc is not None: if not all_ok and wait_proc is not None:
wait_proc() wait_proc()
return all_ok return all_ok
wait_until(check_quorum_connections, timeout=timeout, sleep=0.5) wait_until(check_quorum_connections, timeout=timeout, sleep=1)
def wait_for_quorum_phase(self, quorum_hash, phase, expected_member_count, check_received_messages, check_received_messages_count, timeout=30, sleep=0.1): def wait_for_quorum_phase(self, quorum_hash, phase, expected_member_count, check_received_messages, check_received_messages_count, timeout=30, sleep=0.1):
def check_dkg_session(): def check_dkg_session():
@ -870,7 +870,7 @@ class DashTestFramework(BitcoinTestFramework):
self.log.info("Waiting for phase 1 (init)") self.log.info("Waiting for phase 1 (init)")
def bump_time(): def bump_time():
self.bump_mocktime(30) self.bump_mocktime(1)
set_node_times(self.nodes, self.mocktime) set_node_times(self.nodes, self.mocktime)
self.wait_for_quorum_phase(q, 1, expected_members, None, 0) self.wait_for_quorum_phase(q, 1, expected_members, None, 0)
self.wait_for_quorum_connections(expected_connections=expected_connections, wait_proc=bump_time) self.wait_for_quorum_connections(expected_connections=expected_connections, wait_proc=bump_time)