From 0780e4458ea06c41fc0dfc28c54d022beb5924d8 Mon Sep 17 00:00:00 2001 From: Tom Harding Date: Thu, 3 Dec 2015 16:33:31 -0800 Subject: [PATCH] Fix race condition in CLTV regtests On some systems, these tests fail because the default 200 BIP101-version blocks are mined before the test begins, causing them to think BIP65 is already in effect. --- qa/rpc-tests/bip65-cltv.py | 7 +++++++ qa/rpc-tests/forknotify.py | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/qa/rpc-tests/bip65-cltv.py b/qa/rpc-tests/bip65-cltv.py index 15c7c0e3cf7..82617ad8958 100755 --- a/qa/rpc-tests/bip65-cltv.py +++ b/qa/rpc-tests/bip65-cltv.py @@ -14,6 +14,13 @@ import shutil class BIP65Test(BitcoinTestFramework): + def __init__(self): + self.num_nodes = 3 + + def setup_chain(self): + print "Initializing test directory "+self.options.tmpdir + initialize_chain_clean(self.options.tmpdir, self.num_nodes) + def setup_network(self): self.nodes = [] self.nodes.append(start_node(0, self.options.tmpdir, [])) diff --git a/qa/rpc-tests/forknotify.py b/qa/rpc-tests/forknotify.py index 20e6ce96195..3a4c07f7418 100755 --- a/qa/rpc-tests/forknotify.py +++ b/qa/rpc-tests/forknotify.py @@ -14,6 +14,13 @@ class ForkNotifyTest(BitcoinTestFramework): alert_filename = None # Set by setup_network + def __init__(self): + self.num_nodes = 3 + + def setup_chain(self): + print "Initializing test directory "+self.options.tmpdir + initialize_chain_clean(self.options.tmpdir, self.num_nodes) + def setup_network(self): self.nodes = [] self.alert_filename = os.path.join(self.options.tmpdir, "alert.txt")