From: Sage Weil Date: Wed, 10 Nov 2021 22:22:44 +0000 (-0600) Subject: task/clock: parallelize X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=0094010b32bddf5cb4096521fa98fd92ba93e276;p=teuthology.git task/clock: parallelize Signed-off-by: Sage Weil --- diff --git a/teuthology/task/clock.py b/teuthology/task/clock.py index 022eeaf717..a3f3ecde54 100644 --- a/teuthology/task/clock.py +++ b/teuthology/task/clock.py @@ -30,8 +30,9 @@ def task(ctx, config): """ log.info('Syncing clocks and checking initial clock skew...') - for rem in ctx.cluster.remotes.keys(): - rem.run( + + run.wait( + ctx.cluster.run( args = [ 'sudo', 'systemctl', 'stop', 'ntp.service', run.Raw('||'), 'sudo', 'systemctl', 'stop', 'ntpd.service', run.Raw('||'), @@ -50,22 +51,26 @@ def task(ctx, config): 'true' ], timeout = 360, + wait=False, ) + ) try: yield finally: log.info('Checking final clock skew...') - for rem in ctx.cluster.remotes.keys(): - rem.run( + run.wait( + ctx.cluster.run( args=[ 'PATH=/usr/bin:/usr/sbin', 'ntpq', '-p', run.Raw('||'), 'PATH=/usr/bin:/usr/sbin', 'chronyc', 'sources', run.Raw('||'), 'true' - ], - ) + ], + wait=False, + ) + ) @contextlib.contextmanager @@ -77,27 +82,31 @@ def check(ctx, config): :param config: Configuration """ log.info('Checking initial clock skew...') - for rem in ctx.cluster.remotes.keys(): - rem.run( + run.wait( + ctx.cluster.run( args=[ 'PATH=/usr/bin:/usr/sbin', 'ntpq', '-p', run.Raw('||'), 'PATH=/usr/bin:/usr/sbin', 'chronyc', 'sources', run.Raw('||'), 'true' - ], - ) + ], + wait=False, + ) + ) try: yield finally: log.info('Checking final clock skew...') - for rem in ctx.cluster.remotes.keys(): - rem.run( + run.wait( + ctx.cluster.run( args=[ 'PATH=/usr/bin:/usr/sbin', 'ntpq', '-p', run.Raw('||'), 'PATH=/usr/bin:/usr/sbin', 'chronyc', 'sources', run.Raw('||'), 'true' - ], - ) + ], + wait=False, + ) + )