Skip to content

Commit

Permalink
Merge pull request ceph#1589 from kshtsk/wip-wait
Browse files Browse the repository at this point in the history
Add teuthology-wait command
  • Loading branch information
kshtsk authored Dec 14, 2020
2 parents a4989a9 + 20ce419 commit 8e55e2f
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 2 deletions.
31 changes: 31 additions & 0 deletions scripts/wait.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import docopt
import sys

import logging

import teuthology
import teuthology.suite
from teuthology.config import config

doc = """
usage: teuthology-wait --help
teuthology-wait [-v] --run <name>
Wait until run is finished. Returns exit code 0 on success, otherwise 1.
Miscellaneous arguments:
-h, --help Show this help message and exit
-v, --verbose Be more verbose
Standard arguments:
-r, --run <name> Run name to watch.
"""


def main(argv=sys.argv[1:]):
args = docopt.docopt(doc, argv=argv)
if args.get('--verbose'):
teuthology.log.setLevel(logging.DEBUG)
name = args.get('--run')
return teuthology.suite.wait(name, config.max_job_time, None)

3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@
'teuthology-queue = scripts.queue:main',
'teuthology-prune-logs = scripts.prune_logs:main',
'teuthology-describe = scripts.describe:main',
'teuthology-reimage = scripts.reimage:main'
'teuthology-reimage = scripts.reimage:main',
'teuthology-wait = scripts.wait:main',
],
},

Expand Down
2 changes: 1 addition & 1 deletion teuthology/suite/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def wait(name, max_job_time, upload_url):
reporter = ResultsReporter()
past_unfinished_jobs = []
progress = time.time()
log.info("waiting for the suite to complete")
log.info(f"waiting for the run {name} to complete")
log.debug("the list of unfinished jobs will be displayed "
"every " + str(Run.WAIT_PAUSE / 60) + " minutes")
exit_code = 0
Expand Down

0 comments on commit 8e55e2f

Please sign in to comment.