diff options
author | M Joonas Pihlaja <jpihlaja@cc.helsinki.fi> | 2010-06-04 14:23:22 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2010-06-04 14:23:22 -0400 |
commit | 9c63f026a3447ba61743edd923269bfc3e7d0a0b (patch) | |
tree | f32679293f56a5df8a95b80b5fd550a11bdff2df | |
parent | ea870c08d0581320546ff8b8fc51ced781770376 (diff) | |
download | gpsd-9c63f026a3447ba61743edd923269bfc3e7d0a0b.tar.gz |
Speed up the test suite by killing the daemon faster.
The daemon is rather quick to die on command, so it's enough to keep
on killing it until it's gone, rather than sending a signal to it once
and then gratuitiously sleeping for a second.
Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
-rw-r--r-- | gps/fake.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gps/fake.py b/gps/fake.py index 5e45db2e..ef8cf34b 100644 --- a/gps/fake.py +++ b/gps/fake.py @@ -309,7 +309,7 @@ class DaemonInstance: try: fp = open(self.pidfile) except IOError: - time.sleep(0.5) + time.sleep(0.1) continue try: fp.seek(0) @@ -356,10 +356,13 @@ class DaemonInstance: if self.pid: try: os.kill(self.pid, signal.SIGTERM) + # Raises an OSError for ESRCH when we've killed it. + while True: + os.kill(self.pid, signal.SIGTERM) + time.sleep(0.01) except OSError: pass self.pid = None - time.sleep(1) # Give signal time to land class TestSessionError(exceptions.Exception): def __init__(self, msg): |