diff options
author | MarcoFalke <falke.marco@gmail.com> | 2018-06-18 17:28:37 -0400 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2018-06-25 14:06:41 -0400 |
commit | fa87da2f172ae2e6dc15e9ed156a3564a8ecfbdd (patch) | |
tree | 2693cae5718e45e84182d85a4d041fc084d6bd8e /test/functional/test_framework/test_framework.py | |
parent | fa1eac9cdb1a491d5947b6972b87833792a16fe3 (diff) | |
download | bitcoin-fa87da2f172ae2e6dc15e9ed156a3564a8ecfbdd.tar.xz |
qa: Avoid start/stop of the network thread mid-test
Diffstat (limited to 'test/functional/test_framework/test_framework.py')
-rwxr-xr-x | test/functional/test_framework/test_framework.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/functional/test_framework/test_framework.py b/test/functional/test_framework/test_framework.py index 5c2555c1ff..abe8d12e59 100755 --- a/test/functional/test_framework/test_framework.py +++ b/test/functional/test_framework/test_framework.py @@ -18,6 +18,7 @@ import time from .authproxy import JSONRPCException from . import coverage from .test_node import TestNode +from .mininode import NetworkThread from .util import ( MAX_NODES, PortSeed, @@ -83,6 +84,7 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass): """Sets test framework defaults. Do not override this method. Instead, override the set_test_params() method""" self.setup_clean_chain = False self.nodes = [] + self.network_thread = None self.mocktime = 0 self.supports_cli = False self.bind_to_localhost_only = True @@ -144,6 +146,10 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass): self.options.tmpdir = tempfile.mkdtemp(prefix="test") self._start_logging() + self.log.debug('Setting up network thread') + self.network_thread = NetworkThread() + self.network_thread.start() + success = TestStatus.FAILED try: @@ -171,6 +177,8 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass): print("Testcase failed. Attaching python debugger. Enter ? for help") pdb.set_trace() + self.log.debug('Closing down network thread') + self.network_thread.close() if not self.options.noshutdown: self.log.info("Stopping nodes") if self.nodes: |