[Memory tests] Add timeout to proc_exec (#7942)

* add timeout to proc_exec

* add framework field for db

* upd db fields name
This commit is contained in:
Victor Kuznetsov authored and GitHub committed 2021-10-13 14:25:44 +03:00
1 parent b746c734f8
commit 9e79f997e4
4 files changed
+13 -12

No files matched your search

+2 -2
View File
@@ -10,7 +10,7 @@ import logging
import subprocess
def cmd_exec(args, env=None, log=None, verbose=True, shell=False):
def cmd_exec(args, timeout=None, env=None, log=None, verbose=True, shell=False):
""" Run cmd using subprocess with logging and other improvements
"""
if log is None:
@@ -37,7 +37,7 @@ def cmd_exec(args, env=None, log=None, verbose=True, shell=False):
if line or proc.poll() is None:
continue
break
outs = proc.communicate()[0]
outs = proc.communicate(timeout=timeout)[0]
if outs:
log_out(outs.strip("\n"))