Skip to content

Commit 904129b

Browse files
author
MarcoFalke
committed
Merge #15255: [tests] Remove travis_wait from lint script
8b8d8ee Remove travis_wait from lint script (Graham Krizek) Pull request description: Using the `travis_wait` command in conjunction with `set -o errexit` causes problems. The `travis_wait` command will correctly log the command's output if successful, but if the command fails the process exits before the `travis_wait` command can dump the logs. This will hide important debugging information like error messages and stack traces. We ran into this in #15196 and it was very hard to debug because output was being suppressed. `travis_wait` was being used because the `contrib/verify-commits/verify-commits.py` script can sometimes run for a long time without producing any output. If a script runs for 10 minutes without logging anything, the CI run times out. The `travis_wait` command will extend this timeout by logging a message for you, while sending stderr and stdout to a file. This PR removes the `travis_wait` command from our CI system and adds additional logging to the `verify-commits.py` script so it doesn't make Travis timeout. ACKs for commit 8b8d8e: MarcoFalke: utACK 8b8d8ee Tree-SHA512: 175a8dd3f4d4e03ab272ddba94fa8bb06875c9027c3f3f81577feda4bc8918b5f0e003a19027f04f8cf2d0b56c68633716a6ab23f95b910121a8d1132428767d
2 parents edc68d4 + 8b8d8ee commit 904129b

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

.travis/lint_06_script.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ test/lint/lint-all.sh
2121
if [ "$TRAVIS_REPO_SLUG" = "bitcoin/bitcoin" -a "$TRAVIS_EVENT_TYPE" = "cron" ]; then
2222
git log --merges --before="2 days ago" -1 --format='%H' > ./contrib/verify-commits/trusted-sha512-root-commit
2323
while read -r LINE; do travis_retry gpg --keyserver hkp://subset.pool.sks-keyservers.net --recv-keys $LINE; done < contrib/verify-commits/trusted-keys &&
24-
travis_wait 50 contrib/verify-commits/verify-commits.py --clean-merge=2;
24+
./contrib/verify-commits/verify-commits.py --clean-merge=2;
2525
fi

contrib/verify-commits/verify-commits.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"""Verify commits against a trusted keys list."""
66
import argparse
77
import hashlib
8+
import logging
89
import os
910
import subprocess
1011
import sys
@@ -66,6 +67,11 @@ def tree_sha512sum(commit='HEAD'):
6667
return overall.hexdigest()
6768

6869
def main():
70+
71+
# Enable debug logging if running in CI
72+
if 'CI' in os.environ and os.environ['CI'].lower() == "true":
73+
logging.getLogger().setLevel(logging.DEBUG)
74+
6975
# Parse arguments
7076
parser = argparse.ArgumentParser(usage='%(prog)s [options] [commit id]')
7177
parser.add_argument('--disable-tree-check', action='store_false', dest='verify_tree', help='disable SHA-512 tree check')
@@ -95,6 +101,10 @@ def main():
95101

96102
# Iterate through commits
97103
while True:
104+
105+
# Log a message to prevent Travis from timing out
106+
logging.debug("verify-commits: [in-progress] processing commit {}".format(current_commit[:8]))
107+
98108
if current_commit == verified_root:
99109
print('There is a valid path from "{}" to {} where all commits are signed!'.format(initial_commit, verified_root))
100110
sys.exit(0)

0 commit comments

Comments
 (0)