aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/run_tests/python_utils
diff options
context:
space:
mode:
authorGravatar Matt Kwong <mattkwong@google.com>2017-08-29 12:45:53 -0700
committerGravatar Matt Kwong <mattkwong@google.com>2017-08-29 12:45:53 -0700
commit738b1bb424292b4138e82a3c2085ab4a3a95507e (patch)
tree9ad4dad981b4ccb68f0f2d10c81d59c7203b8103 /tools/run_tests/python_utils
parent3da8c5defbc9a83d3db0bf84fb0dce012802d9b3 (diff)
Get rid of have_alarm var in jobset.py
Diffstat (limited to 'tools/run_tests/python_utils')
-rwxr-xr-xtools/run_tests/python_utils/jobset.py15
1 files changed, 4 insertions, 11 deletions
diff --git a/tools/run_tests/python_utils/jobset.py b/tools/run_tests/python_utils/jobset.py
index 50fe7d7df8..6151a7276a 100755
--- a/tools/run_tests/python_utils/jobset.py
+++ b/tools/run_tests/python_utils/jobset.py
@@ -71,10 +71,8 @@ def platform_string():
if platform_string() == 'windows':
pass
else:
- have_alarm = False
def alarm_handler(unused_signum, unused_frame):
- global have_alarm
- have_alarm = False
+ pass
signal.signal(signal.SIGCHLD, lambda unused_signum, unused_frame: None)
signal.signal(signal.SIGALRM, alarm_handler)
@@ -454,10 +452,7 @@ class Jobset(object):
if platform_string() == 'windows':
time.sleep(0.1)
else:
- global have_alarm
- if not have_alarm:
- have_alarm = True
- signal.alarm(10)
+ signal.alarm(10)
signal.pause()
def cancelled(self):
@@ -473,10 +468,8 @@ class Jobset(object):
while self._running:
if self.cancelled(): pass # poll cancellation
self.reap()
- global have_alarm
- if platform_string() != 'windows' and have_alarm:
- signal.alarm(1)
- signal.pause()
+ if platform_string() != 'windows':
+ signal.alarm(0)
return not self.cancelled() and self._failures == 0