Skip to content

Commit d7ba4a2

Browse files
author
MarcoFalke
committed
Merge #9257: [qa] Dump debug logs on travis failures.
0828619 [qa] Dump debug logs on travis failures. (Suhas Daftuar)
2 parents 9851498 + 0828619 commit d7ba4a2

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

qa/rpc-tests/test_framework/test_framework.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,16 @@ def main(self):
172172
os.rmdir(self.options.root)
173173
else:
174174
print("Not cleaning up dir %s" % self.options.tmpdir)
175-
175+
if os.getenv("PYTHON_DEBUG", ""):
176+
# Dump the end of the debug logs, to aid in debugging rare
177+
# travis failures.
178+
import glob
179+
filenames = glob.glob(self.options.tmpdir + "/node*/regtest/debug.log")
180+
MAX_LINES_TO_PRINT = 1000
181+
for f in filenames:
182+
print("From" , f, ":")
183+
from collections import deque
184+
print("".join(deque(open(f), MAX_LINES_TO_PRINT)))
176185
if success:
177186
print("Tests successful")
178187
sys.exit(0)

0 commit comments

Comments
 (0)