Skip to content

Commit 75bacab

Browse files
committed
test: combine_logs.py - Output debug.log paths on error
1 parent bffd92f commit 75bacab

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

test/functional/combine_logs.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,12 @@ def read_logs(tmp_dir):
7979
Delegates to generator function get_log_events() to provide individual log events
8080
for each of the input log files."""
8181

82-
# Find out what the folder is called that holds the debug.log file
83-
glob = pathlib.Path(tmp_dir).glob('node0/**/debug.log')
84-
path = next(glob, None)
85-
if path:
86-
assert next(glob, None) is None # more than one debug.log, should never happen
82+
# Find out what the folder is called that holds node 0's debug.log file
83+
debug_logs = list(pathlib.Path(tmp_dir).glob('node0/**/debug.log'))
84+
if len(debug_logs) > 0:
85+
assert len(debug_logs) < 2, 'Max one debug.log is supported, ' \
86+
'found several:\n\t' + '\n\t'.join([str(f) for f in debug_logs])
87+
path = debug_logs[0]
8788
chain = re.search(r'node0/(.+?)/debug\.log$', path.as_posix()).group(1) # extract the chain name
8889
else:
8990
chain = 'regtest' # fallback to regtest (should only happen when none exists)

0 commit comments

Comments
 (0)