Browse Source

Merge #9257: [qa] Dump debug logs on travis failures.

0828619 [qa] Dump debug logs on travis failures. (Suhas Daftuar)
0.14
MarcoFalke 8 years ago
parent
commit
d7ba4a233b
No known key found for this signature in database
GPG Key ID: 2D7F2372E50FE137
  1. 11
      qa/rpc-tests/test_framework/test_framework.py

11
qa/rpc-tests/test_framework/test_framework.py

@ -172,7 +172,16 @@ class BitcoinTestFramework(object):
os.rmdir(self.options.root) os.rmdir(self.options.root)
else: else:
print("Not cleaning up dir %s" % self.options.tmpdir) 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: if success:
print("Tests successful") print("Tests successful")
sys.exit(0) sys.exit(0)

Loading…
Cancel
Save