Skip to content

Commit 29bff0e

Browse files
committed
Add some travis debugging for python scripts
Adds printing to the console before/after calls to bitcoin-cli -rpcwait, if the PYTHON_DEBUG environment variable is initialized.
1 parent d76412b commit 29bff0e

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ env:
1616
- CCACHE_COMPRESS=1
1717
- BASE_OUTDIR=$TRAVIS_BUILD_DIR/out
1818
- SDK_URL=https://bitcoincore.org/depends-sources/sdks
19+
- PYTHON_DEBUG=1
1920
cache:
2021
apt: true
2122
directories:

qa/rpc-tests/util.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,12 @@ def initialize_chain(test_dir):
8888
if i > 0:
8989
args.append("-connect=127.0.0.1:"+str(p2p_port(0)))
9090
bitcoind_processes[i] = subprocess.Popen(args)
91+
if os.getenv("PYTHON_DEBUG", ""):
92+
print "initialize_chain: bitcoind started, calling bitcoin-cli -rpcwait getblockcount"
9193
subprocess.check_call([ os.getenv("BITCOINCLI", "bitcoin-cli"), "-datadir="+datadir,
9294
"-rpcwait", "getblockcount"], stdout=devnull)
95+
if os.getenv("PYTHON_DEBUG", ""):
96+
print "initialize_chain: bitcoin-cli -rpcwait getblockcount completed"
9397
devnull.close()
9498
rpcs = []
9599
for i in range(4):
@@ -169,9 +173,13 @@ def start_node(i, dirname, extra_args=None, rpchost=None, timewait=None, binary=
169173
if extra_args is not None: args.extend(extra_args)
170174
bitcoind_processes[i] = subprocess.Popen(args)
171175
devnull = open("/dev/null", "w+")
176+
if os.getenv("PYTHON_DEBUG", ""):
177+
print "start_node: bitcoind started, calling bitcoin-cli -rpcwait getblockcount"
172178
subprocess.check_call([ os.getenv("BITCOINCLI", "bitcoin-cli"), "-datadir="+datadir] +
173179
_rpchost_to_args(rpchost) +
174180
["-rpcwait", "getblockcount"], stdout=devnull)
181+
if os.getenv("PYTHON_DEBUG", ""):
182+
print "start_node: calling bitcoin-cli -rpcwait getblockcount returned"
175183
devnull.close()
176184
url = "http://rt:rt@%s:%d" % (rpchost or '127.0.0.1', rpc_port(i))
177185
if timewait is not None:

0 commit comments

Comments
 (0)