summaryrefslogtreecommitdiff
path: root/gpsfake.py
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2006-12-05 16:02:16 +0000
committerEric S. Raymond <esr@thyrsus.com>2006-12-05 16:02:16 +0000
commit835c260cc1ea9850e1e40f12f83053bb3a1106c4 (patch)
treeda33cbedfc4daf880233b9637f53bbd86ffb43cc /gpsfake.py
parent802e16a00025cfc660b1ded9eeaf31e2686e1b49 (diff)
downloadgpsd-835c260cc1ea9850e1e40f12f83053bb3a1106c4.tar.gz
Attempt to avoid an occasional race condition in gpsfake.
Diffstat (limited to 'gpsfake.py')
-rw-r--r--gpsfake.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/gpsfake.py b/gpsfake.py
index 63219880..8a314480 100644
--- a/gpsfake.py
+++ b/gpsfake.py
@@ -290,6 +290,9 @@ class FakeGPS:
self.go_predicate(self.index, self):
os.write(self.master_fd, self.testload.sentences[self.index % len(self.testload.sentences)])
self.index += 1
+ # Voodoo programming -- try to avoid the race condition where the
+ # daemon sometimes doesn't see the last few lines of logs.
+ time.sleep(0.1)
def start(self, daemon, thread=False):
"Increment pseudodevice's reader count, starting it if necessary."
self.daemon = daemon
@@ -509,6 +512,9 @@ class TestSession:
self.progress("gpsfake: cleanup()\n")
while self.gps_count():
time.sleep(0.1)
+ # Voodoo programming -- try to avoid the race condition where the
+ # daemon sometimes doesn't see the last few lines of logs.
+ time.sleep(0.1)
self.daemon.kill()
def killall(self):
"Kill all fake-GPS threads and the daemon."