Skip to content

Commit

Permalink
Merge bitcoin#11472: qa: Make tmpdir option an absolute path, misc cl…
Browse files Browse the repository at this point in the history
…eanup

fafa003 qa: Remove never used return value of sync_with_ping (MarcoFalke)
fa9de37 qa: Make tmpdir option an absolute path (MarcoFalke)

Pull request description:

  This should fix issues with the multiwallet test and its symlinks
  when the tmpdir is a relative path.

  Rather than fixing os.symlink to work with paths relative to a
  directory descriptor, which does not work on Windows, normalize
  the path instead.

Tree-SHA512: 189690f3d065ea2f0f48e06775c86d513d0916c7c86312432e8e16df160e65539e288c2bd53d49a4180735fa940f6fcd52b506ccd7d9815651a9b1a69850dda6
  • Loading branch information
laanwj committed Oct 18, 2017
2 parents 50d72b3 + fafa003 commit 6759a24
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
9 changes: 6 additions & 3 deletions test/functional/p2p-acceptblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ def run_test(self):
test_node.send_message(msg_block(blocks_h2[0]))
white_node.send_message(msg_block(blocks_h2[1]))

[ x.sync_with_ping() for x in [test_node, white_node] ]
for x in [test_node, white_node]:
x.sync_with_ping()
assert_equal(self.nodes[0].getblockcount(), 2)
assert_equal(self.nodes[1].getblockcount(), 2)
self.log.info("First height 2 block accepted by both nodes")
Expand All @@ -116,7 +117,8 @@ def run_test(self):
test_node.send_message(msg_block(blocks_h2f[0]))
white_node.send_message(msg_block(blocks_h2f[1]))

[ x.sync_with_ping() for x in [test_node, white_node] ]
for x in [test_node, white_node]:
x.sync_with_ping()
for x in self.nodes[0].getchaintips():
if x['hash'] == blocks_h2f[0].hash:
assert_equal(x['status'], "headers-only")
Expand All @@ -135,7 +137,8 @@ def run_test(self):
test_node.send_message(msg_block(blocks_h3[0]))
white_node.send_message(msg_block(blocks_h3[1]))

[ x.sync_with_ping() for x in [test_node, white_node] ]
for x in [test_node, white_node]:
x.sync_with_ping()
# Since the earlier block was not processed by node0, the new block
# can't be fully validated.
for x in self.nodes[0].getchaintips():
Expand Down
1 change: 0 additions & 1 deletion test/functional/test_framework/mininode.py
Original file line number Diff line number Diff line change
Expand Up @@ -1615,7 +1615,6 @@ def sync_with_ping(self, timeout=60):
test_function = lambda: self.last_message.get("pong") and self.last_message["pong"].nonce == self.ping_counter
wait_until(test_function, timeout=timeout, lock=mininode_lock)
self.ping_counter += 1
return True

# The actual NodeConn class
# This class provides an interface for a p2p connection to a specified node
Expand Down
3 changes: 3 additions & 0 deletions test/functional/test_framework/test_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,11 @@ def main(self):

check_json_precision()

self.options.cachedir = os.path.abspath(self.options.cachedir)

# Set up temp directory and start logging
if self.options.tmpdir:
self.options.tmpdir = os.path.abspath(self.options.tmpdir)
os.makedirs(self.options.tmpdir, exist_ok=False)
else:
self.options.tmpdir = tempfile.mkdtemp(prefix="test")
Expand Down

0 comments on commit 6759a24

Please sign in to comment.