Skip to content

Commit d580707

Browse files
committed
Print out the final 1000 lines of test_framework.log if test fails
1 parent 1135f95 commit d580707

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

qa/rpc-tests/test_framework/test_framework.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
# Base class for RPC testing
77

8+
from collections import deque
89
import logging
910
import optparse
1011
import os
@@ -172,12 +173,15 @@ def main(self):
172173
# Dump the end of the debug logs, to aid in debugging rare
173174
# travis failures.
174175
import glob
175-
filenames = glob.glob(self.options.tmpdir + "/node*/regtest/debug.log")
176+
filenames = [self.options.tmpdir + "/test_framework.log"]
177+
filenames += glob.glob(self.options.tmpdir + "/node*/regtest/debug.log")
176178
MAX_LINES_TO_PRINT = 1000
177179
for f in filenames:
178-
print("From" , f, ":")
179-
from collections import deque
180-
print("".join(deque(open(f), MAX_LINES_TO_PRINT)))
180+
try:
181+
print("From" , f, ":")
182+
print("".join(deque(open(f), MAX_LINES_TO_PRINT)))
183+
except:
184+
pass
181185
if success:
182186
self.log.info("Tests successful")
183187
sys.exit(0)

0 commit comments

Comments
 (0)