]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
check-memory: if the child process fails to start, shut down instead of hanging forever
authorBrian Warner <warner@lothar.com>
Sat, 15 Sep 2007 03:16:57 +0000 (20:16 -0700)
committerBrian Warner <warner@lothar.com>
Sat, 15 Sep 2007 03:16:57 +0000 (20:16 -0700)
src/allmydata/test/check_memory.py

index 2d82f6642b3fbc6fab7721cf384ae92f7ef4ce97..3ffa3d1423c645db3f70ca448db9de52251ad86a 100644 (file)
@@ -183,6 +183,8 @@ this file are ignored.
         # control.furl file to appear.
         furl_file = os.path.join(clientdir, "control.furl")
         def _check():
+            if pp.ended:
+                raise RuntimeError("process ended while waiting for startup")
             return os.path.exists(furl_file)
         d = self.poll(_check, 0.1)
         # once it exists, wait a moment before we read from it, just in case
@@ -333,11 +335,14 @@ this file are ignored.
 
 
 class ClientWatcher(protocol.ProcessProtocol):
+    ended = False
     def outReceived(self, data):
         print "OUT:", data
     def errReceived(self, data):
         print "ERR:", data
     def processEnded(self, reason):
+        print "PROCESSENDED", reason
+        self.ended = True
         self.d.callback(None)