aboutsummaryrefslogtreecommitdiff
path: root/test/functional/example_test.py
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2018-06-29 18:04:25 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2018-06-29 18:10:57 +0200
commita6ed99a1e6facd38913711106bce6fb65bd14862 (patch)
tree6b6220f2d44a9e1ec696ee98c0890ca7c2913f9a /test/functional/example_test.py
parentf3c9c40aeb1207c5839fcb642addc243b8a8b34e (diff)
parentfa87da2f172ae2e6dc15e9ed156a3564a8ecfbdd (diff)
Merge #13517: qa: Remove need to handle the network thread in tests
fa87da2f172ae2e6dc15e9ed156a3564a8ecfbdd qa: Avoid start/stop of the network thread mid-test (MarcoFalke) Pull request description: This simplifies test writing by removing the need to handle the network thread in tests. E.g. start thread, join thread, restart thread mid-test, adding p2p connections at the "right" time, ... Tree-SHA512: 533642f12fef5496f1933855edcdab1a7ed901d088d34911749cd0f9e044c8a6cb1f89985ac3a7f41a512943663e4e270a61978f6f072143ae050cd102d4eab8
Diffstat (limited to 'test/functional/example_test.py')
-rwxr-xr-xtest/functional/example_test.py10
1 files changed, 0 insertions, 10 deletions
diff --git a/test/functional/example_test.py b/test/functional/example_test.py
index 05d1c1bf4e..e2f1cc05b3 100755
--- a/test/functional/example_test.py
+++ b/test/functional/example_test.py
@@ -21,8 +21,6 @@ from test_framework.mininode import (
mininode_lock,
msg_block,
msg_getdata,
- network_thread_join,
- network_thread_start,
)
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
@@ -135,9 +133,6 @@ class ExampleTest(BitcoinTestFramework):
# Create P2P connections to two of the nodes
self.nodes[0].add_p2p_connection(BaseNode())
- # Start up network handling in another thread. This needs to be called
- # after the P2P connections have been created.
- network_thread_start()
# wait_for_verack ensures that the P2P connection is fully up.
self.nodes[0].p2p.wait_for_verack()
@@ -189,14 +184,9 @@ class ExampleTest(BitcoinTestFramework):
connect_nodes(self.nodes[1], 2)
self.log.info("Add P2P connection to node2")
- # We can't add additional P2P connections once the network thread has started. Disconnect the connection
- # to node0, wait for the network thread to terminate, then connect to node2. This is specific to
- # the current implementation of the network thread and may be improved in future.
self.nodes[0].disconnect_p2ps()
- network_thread_join()
self.nodes[2].add_p2p_connection(BaseNode())
- network_thread_start()
self.nodes[2].p2p.wait_for_verack()
self.log.info("Wait for node2 reach current tip. Test that it has propagated all the blocks to us")