Browse Source

[qa] Dump debug logs on travis failures.

tags/v0.15.1
Suhas Daftuar 5 years ago
parent
commit
0828619e96
1 changed files with 10 additions and 1 deletions
  1. 10
    1
      qa/rpc-tests/test_framework/test_framework.py

+ 10
- 1
qa/rpc-tests/test_framework/test_framework.py View File

@@ -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)

Loading…
Cancel
Save