diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2006-12-05 16:02:16 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2006-12-05 16:02:16 +0000 |
commit | 835c260cc1ea9850e1e40f12f83053bb3a1106c4 (patch) | |
tree | da33cbedfc4daf880233b9637f53bbd86ffb43cc /gpsfake.py | |
parent | 802e16a00025cfc660b1ded9eeaf31e2686e1b49 (diff) | |
download | gpsd-835c260cc1ea9850e1e40f12f83053bb3a1106c4.tar.gz |
Attempt to avoid an occasional race condition in gpsfake.
Diffstat (limited to 'gpsfake.py')
-rw-r--r-- | gpsfake.py | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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." |