[Neo-report] r2088 gregory - /trunk/neo/tests/functional/__init__.py

nobody at svn.erp5.org nobody at svn.erp5.org
Fri May 7 16:49:42 CEST 2010


Author: gregory
Date: Fri May  7 16:49:42 2010
New Revision: 2088

Log:
Allow start a test cluster without leave the recovery state.

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] Fri May  7 16:49:42 2010
@@ -258,26 +258,32 @@
         sql_connection.commit()
         sql_connection.close()
 
-    def start(self, except_storages=()):
-        neoctl = self.neoctl
+    def run(self, except_storages=()):
+        """ Start cluster processes except some storage nodes """
         assert len(self.process_dict)
         for process_list in self.process_dict.itervalues():
             for process in process_list:
                 if process not in except_storages:
                     process.start()
-        # Try to put cluster in running state. This will succeed as soon as
-        # admin node could connect to the primary master node.
+        # wait for the admin node availability
         end_time = time.time() + MAX_START_TIME
         while True:
             if time.time() > end_time:
                 raise AssertionError, 'Timeout when starting cluster'
             try:
-                neoctl.startCluster()
+                self.neoctl.getClusterState()
             except NotReadyException:
                 time.sleep(0.5)
             else:
                 break
+
+    def start(self, except_storages=()):
+        """ Do a complete start of a cluster """
+        self.run(except_storages=except_storages)
+        neoctl = self.neoctl
+        neoctl.startCluster()
         target_count = len(self.db_list) - len(except_storages)
+        end_time = time.time() + MAX_START_TIME
         while True:
             if time.time() > end_time:
                 raise AssertionError, 'Timeout when starting cluster'





More information about the Neo-report mailing list