summaryrefslogtreecommitdiffstats
path: root/qa/tasks/vstart_runner.py
diff options
context:
space:
mode:
authorRishabh Dave <ridave@redhat.com>2024-04-03 07:41:29 +0200
committerRishabh Dave <ridave@redhat.com>2024-04-17 06:39:59 +0200
commit8bc23e50df7b2f4ee4792271a2aad43614caf00f (patch)
tree2b1568029ed2453d6f30312af9d036834a300d5c /qa/tasks/vstart_runner.py
parentMerge pull request #55652 from clwluvw/rgw-blockaccesspublic (diff)
downloadceph-8bc23e50df7b2f4ee4792271a2aad43614caf00f.tar.xz
ceph-8bc23e50df7b2f4ee4792271a2aad43614caf00f.zip
qa/vstart_runner: don't let command run after timeout
Parameter "timeout" is accepted by LocalRemote.run() but the method doesn't do anything about it besides accepting it. Thus, this parameter has no effect. In LocalRemote.run(), pass this parameter to LocalRemoteProcess.wait() and from this method pass it to subprocess.Popen.communicate(). Thus, command will be terminated by subprocess module at seconds specified by "timeout" parameter. IOW, "timeout" parameter will have an effect. Fixes: https://tracker.ceph.com/issues/65533 Signed-off-by: Rishabh Dave <ridave@redhat.com>
Diffstat (limited to '')
-rw-r--r--qa/tasks/vstart_runner.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/qa/tasks/vstart_runner.py b/qa/tasks/vstart_runner.py
index 8d9dc6f1845..b5dbe3c5f97 100644
--- a/qa/tasks/vstart_runner.py
+++ b/qa/tasks/vstart_runner.py
@@ -233,7 +233,7 @@ class LocalRemoteProcess(object):
else:
self.stderr.write(err)
- def wait(self):
+ def wait(self, timeout=None):
# Null subproc.stdin so communicate() does not try flushing/closing it
# again.
if self.stdin is not None and self.stdin.closed:
@@ -249,7 +249,7 @@ class LocalRemoteProcess(object):
else:
return
- out, err = self.subproc.communicate()
+ out, err = self.subproc.communicate(timeout=timeout)
out, err = rm_nonascii_chars(out), rm_nonascii_chars(err)
self._write_stdout(out)
self._write_stderr(err)
@@ -488,7 +488,7 @@ sudo() {
)
if wait:
- proc.wait()
+ proc.wait(timeout)
return proc