]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
fix circ better timing-fixed
authorZack Cerza <zack@redhat.com>
Wed, 15 Mar 2023 21:28:32 +0000 (15:28 -0600)
committerZack Cerza <zack@redhat.com>
Wed, 15 Mar 2023 21:31:18 +0000 (15:31 -0600)
teuthology/beanstalk.py
teuthology/dispatcher/__init__.py
teuthology/dispatcher/supervisor.py
teuthology/lock/ops.py
teuthology/nuke/__init__.py
teuthology/worker.py

index abba88ea85ace1d40a05114e246e9440530e3364..76bc2c97ae63bbe32cabc9035dbd406a829d9c3c 100644 (file)
@@ -6,8 +6,7 @@ import pprint
 import sys
 from collections import OrderedDict
 
-import teuthology.report as report
-
+from teuthology import report
 from teuthology.config import config
 
 log = logging.getLogger(__name__)
index 69b27072bff15adb2c80b2e88ed7e320b53b97d2..3d31a1f2a59c072f54e7512b3426c3f2a0ce38bd 100644 (file)
@@ -8,16 +8,20 @@ import yaml
 from datetime import datetime
 from typing import Dict, List
 
-import teuthology.dispatcher.supervisor as supervisor
-import teuthology.lock.ops as lock_ops
-import teuthology.nuke as nuke
-import teuthology.worker as worker
-
-from teuthology import setup_log_file, install_except_hook
-from teuthology import beanstalk
-from teuthology import report
+from teuthology import (
+    # non-modules
+    setup_log_file,
+    install_except_hook,
+    # modules
+    beanstalk,
+    nuke,
+    report,
+    worker,
+)
 from teuthology.config import config as teuth_config
+from teuthology.dispatcher import supervisor
 from teuthology.exceptions import SkipJob
+from teuthology.lock import ops as lock_ops
 from teuthology.repo_utils import fetch_qa_suite, fetch_teuthology
 from teuthology import safepath
 
index c38118a378f0721e9712b789ff79a1b1b182c854..caf0e802c8240e61ae0d3facb375386109daba66 100644 (file)
@@ -8,19 +8,15 @@ import requests
 from urllib.parse import urljoin
 from datetime import datetime
 
-import teuthology.lock.ops as lock_ops
-import teuthology.nuke as nuke
-
-from teuthology import report
-from teuthology import safepath
+from teuthology import kill, nuke, report, safepath
 from teuthology.config import config as teuth_config
 from teuthology.exceptions import SkipJob, MaxWhileTries
 from teuthology import setup_log_file, install_except_hook
 from teuthology.misc import get_user, archive_logs, compress_logs
 from teuthology.config import FakeNamespace
 from teuthology.job_status import get_status
-from teuthology.kill import kill_job
-from teuthology.task.internal import add_remotes
+from teuthology.lock import ops as lock_ops
+from teuthology.task import internal
 from teuthology.misc import decanonicalize_hostname as shortname
 from teuthology.lock import query
 
@@ -285,9 +281,11 @@ def run_with_watchdog(process, job_config):
             try:
                 # kill processes but do not nuke yet so we can save
                 # the logs, coredumps, etc.
-                kill_job(job_info['name'], job_info['job_id'],
-                         teuth_config.archive_base, job_config['owner'],
-                         skip_nuke=True)
+                kill.kill_job(
+                    job_info['name'], job_info['job_id'],
+                    teuth_config.archive_base, job_config['owner'],
+                    skip_nuke=True
+                )
             except Exception:
                 log.exception('Failed to kill job')
 
@@ -299,8 +297,10 @@ def run_with_watchdog(process, job_config):
 
             try:
                 # this time remove everything and unlock the machines
-                kill_job(job_info['name'], job_info['job_id'],
-                         teuth_config.archive_base, job_config['owner'])
+                kill.kill_job(
+                    job_info['name'], job_info['job_id'],
+                    teuth_config.archive_base, job_config['owner']
+                )
             except Exception:
                 log.exception('Failed to kill job and unlock machines')
 
@@ -350,7 +350,7 @@ def transfer_archives(run_name, job_id, archive_base, job_config):
 
     if 'archive' in job_info:
         ctx = create_fake_context(job_config)
-        add_remotes(ctx, job_config)
+        internal.add_remotes(ctx, job_config)
 
         for log_type, log_path in job_info['archive'].items():
             if log_type == 'init':
index bc66dd1c62b34a5ae185fa1feec6a1024ddce11a..e33e7d5c5a53f92a8f390fb9a1cda0f7be2fa2b9 100644 (file)
@@ -10,9 +10,8 @@ import requests
 import teuthology.orchestra.remote
 import teuthology.parallel
 import teuthology.provision
-import teuthology.report as report
 
-from teuthology import misc
+from teuthology import misc, report
 from teuthology.config import config
 from teuthology.contextutil import safe_while
 from teuthology.task import console_log
index 15749702b3c3033bd06d2c8ea635671ac8bdcfc0..77d48ccc00a6aaf60ed62be91c5ded6ca202a5ec 100644 (file)
@@ -8,9 +8,9 @@ import subprocess
 import yaml
 
 import teuthology
-import teuthology.lock.ops as lock_ops
 
 from teuthology import provision
+from teuthology.lock import ops as lock_ops
 from teuthology.lock.query import is_vm, list_locks, \
     find_stale_locks, get_status
 from teuthology.lock.util import locked_since_seconds
index b99fab33d7546d5ff02e6d9009ec604fdf4c7949..cb3030da1129f33ee4d86034c5689f03b70d01ba 100644 (file)
@@ -8,14 +8,13 @@ import yaml
 
 from datetime import datetime
 
-from teuthology import setup_log_file, install_except_hook
+from teuthology import setup_log_file, install_except_hook, kill
 from teuthology import beanstalk
 from teuthology import report
 from teuthology import safepath
 from teuthology.config import config as teuth_config
 from teuthology.config import set_config_attr
 from teuthology.exceptions import BranchNotFoundError, CommitNotFoundError, SkipJob, MaxWhileTries
-from teuthology.kill import kill_job
 from teuthology.repo_utils import fetch_qa_suite, fetch_teuthology, ls_remote, build_git_url
 
 log = logging.getLogger(__name__)
@@ -331,7 +330,7 @@ def run_with_watchdog(process, job_config):
         if total_seconds > teuth_config.max_job_time:
             log.warning("Job ran longer than {max}s. Killing...".format(
                 max=teuth_config.max_job_time))
-            kill_job(job_info['name'], job_info['job_id'],
+            kill.kill_job(job_info['name'], job_info['job_id'],
                      teuth_config.archive_base, job_config['owner'])
 
         # calling this without a status just updates the jobs updated time