From eb95dabc3f5cac18c4efd33f595bbf9799901f33 Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Mon, 28 Sep 2020 11:03:21 -0700 Subject: [PATCH] qa: fix proc exit status check Fixes: f30a84b6a7a21670d8b5c5a7fe19df70e4371260 Fixes: https://tracker.ceph.com/issues/47677 Signed-off-by: Patrick Donnelly --- qa/tasks/ceph.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/qa/tasks/ceph.py b/qa/tasks/ceph.py index 2276c5bd2b2..798fe7c50f2 100644 --- a/qa/tasks/ceph.py +++ b/qa/tasks/ceph.py @@ -177,12 +177,12 @@ def ceph_log(ctx, config): while not self.stop_event.is_set(): self.stop_event.wait(timeout=30) try: - p = ctx.cluster.run( - args=['sudo', 'logrotate', '/etc/logrotate.d/ceph-test.conf'], - wait=False, - stderr=StringIO() + procs = ctx.cluster.run( + args=['sudo', 'logrotate', '/etc/logrotate.d/ceph-test.conf'], + wait=False, + stderr=StringIO() ) - run.wait(p) + run.wait(procs) except exceptions.ConnectionLostError as e: # Some tests may power off nodes during test, in which # case we will see connection errors that we should ignore. @@ -197,11 +197,13 @@ def ceph_log(ctx, config): except SSHException: log.debug("Missed logrotate, SSHException") except run.CommandFailedError as e: - err = p.stderr.getvalue() - if 'error: error renaming temp state file' in err: - log.info('ignoring transient state error: %s', e) - else: - raise + for p in procs: + if p.finished and p.exitstatus != 0: + err = p.stderr.getvalue() + if 'error: error renaming temp state file' in err: + log.info('ignoring transient state error: %s', e) + else: + raise except socket.error as e: if e.errno in (errno.EHOSTUNREACH, errno.ECONNRESET): log.debug("Missed logrotate, host unreachable") -- 2.39.5