aboutsummaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2016-12-02 16:40:50 +0100
committerMarcoFalke <falke.marco@gmail.com>2016-12-02 16:41:12 +0100
commitd7ba4a233bd5a6f8fadee681c68a995e23fe36d7 (patch)
tree4d274afb25c4d0b456d73e823f76ec411b6ce785 /qa
parent98514988a3d3e8b7dbf0463884a5c38f5ed5562d (diff)
parent0828619e9660bef4454c5a447a0962b8f906a33d (diff)
Merge #9257: [qa] Dump debug logs on travis failures.
0828619 [qa] Dump debug logs on travis failures. (Suhas Daftuar)
Diffstat (limited to 'qa')
-rwxr-xr-xqa/rpc-tests/test_framework/test_framework.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/qa/rpc-tests/test_framework/test_framework.py b/qa/rpc-tests/test_framework/test_framework.py
index e6d3e9ab9a..98c4f6070b 100755
--- a/qa/rpc-tests/test_framework/test_framework.py
+++ b/qa/rpc-tests/test_framework/test_framework.py
@@ -172,7 +172,16 @@ class BitcoinTestFramework(object):
os.rmdir(self.options.root)
else:
print("Not cleaning up dir %s" % self.options.tmpdir)
-
+ if os.getenv("PYTHON_DEBUG", ""):
+ # Dump the end of the debug logs, to aid in debugging rare
+ # travis failures.
+ import glob
+ filenames = glob.glob(self.options.tmpdir + "/node*/regtest/debug.log")
+ MAX_LINES_TO_PRINT = 1000
+ for f in filenames:
+ print("From" , f, ":")
+ from collections import deque
+ print("".join(deque(open(f), MAX_LINES_TO_PRINT)))
if success:
print("Tests successful")
sys.exit(0)