Commit 27771ee4 authored by Dylan Baker's avatar Dylan Baker

framework/test/base.py: Add environment variable to overwrite timeouts

This variable allows timeouts to be disabled, which can be useful for
debugging tests.
Signed-off-by: 's avatarDylan Baker <dylanx.c.baker@intel.com>
parent d1cc63f5
......@@ -304,6 +304,10 @@ behaves.
undesirable, setting this environment variable to True will disable this
system.
PIGLIT_NO_TIMEOUT
When this variable is true in python then any timeouts given by tests
will be ignored, and they will run until completion or they are killed.
3.2 Note
--------
......
......@@ -76,6 +76,10 @@ __all__ = [
'is_crash_returncode',
]
# Allows timeouts to be suppressed by setting the environment variable
# PIGLIT_NO_TIMEOUT to anything that bool() will resolve as True
_SUPPRESS_TIMEOUT = bool(os.environ.get('PIGLIT_NO_TIMEOUT', False))
class TestIsSkip(exceptions.PiglitException):
"""Exception raised in is_skip() if the test is a skip."""
......@@ -270,7 +274,10 @@ class Test(object):
**_EXTRA_POPEN_ARGS)
self.result.pid = proc.pid
out, err = proc.communicate(timeout=self.timeout)
if not _SUPPRESS_TIMEOUT:
out, err = proc.communicate(timeout=self.timeout)
else:
out, err = proc.communicate()
returncode = proc.returncode
except OSError as e:
# Different sets of tests get built under different build
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment