[Neo-report] r2344 vincent - /trunk/neo/tests/functional/__init__.py

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Oct 4 10:42:09 CEST 2010


Author: vincent
Date: Mon Oct  4 10:42:07 2010
New Revision: 2344

Log:
Do not rely on proc to know if a process is running.

Modified:
    trunk/neo/tests/functional/__init__.py

Modified: trunk/neo/tests/functional/__init__.py
==============================================================================
--- trunk/neo/tests/functional/__init__.py [iso-8859-1] (original)
+++ trunk/neo/tests/functional/__init__.py [iso-8859-1] Mon Oct  4 10:42:07 2010
@@ -147,8 +147,16 @@ class NEOProcess(object):
         self.arg_dict['--uuid'] = dump(uuid)
 
     def isAlive(self):
-        return os.path.exists('/proc/%d' % self.pid)
-
+        try:
+            os.kill(self.pid, 0)
+        except OSError, (errno, msg):
+            if errno == 3: # No such process
+                result = False
+            else:
+                raise
+        else:
+            result = True
+        return result
 
 class NEOCluster(object):
 





More information about the Neo-report mailing list