From: Ondrej Lichtner olichtne@redhat.com
Instead of waiting forever by default, we should wait for the DEFAULT_TIMEOUT amount, and offer the option to wait for forever when explicitly chosen. If something is broken, freezing forever due to unlimited wait is usually not what the test developer intended/expected.
Signed-off-by: Ondrej Lichtner olichtne@redhat.com --- lnst/Controller/Job.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/lnst/Controller/Job.py b/lnst/Controller/Job.py index f1feae6..89b8451 100644 --- a/lnst/Controller/Job.py +++ b/lnst/Controller/Job.py @@ -14,6 +14,7 @@ olichtne@redhat.com (Ondrej Lichtner) import logging import signal from lnst.Common.JobError import JobError +from lnst.Common.NetTestCommand import DEFAULT_TIMEOUT from lnst.Tests.BaseTestModule import BaseTestModule from lnst.Controller.RecipeResults import ResultLevel
@@ -145,13 +146,14 @@ class Job(object): else: return False
- def wait(self, timeout=0): + def wait(self, timeout=DEFAULT_TIMEOUT): """waits for the Job to finish for the specified amount of time
Args: timeout -- integer value indicating how long to wait for. - Default is 0, means wait forever. Don't use for infinitelly - running Jobs. + Default is DEFAULT_TIMEOUT. + Use zero to wait forever. Don't use for infinitelly running + jobs... If non-zero LNST uses a timed SIGALARM signal to return from this method. Returns: