diff --git a/erp5/util/benchmark/scalability_launcher.py b/erp5/util/benchmark/scalability_launcher.py index a28ed4dfeff768f7a3de0e41f50eb7b6d5de7e9e..fee9f8d58086efe335812a1ccf877c0bd0b60634 100644 --- a/erp5/util/benchmark/scalability_launcher.py +++ b/erp5/util/benchmark/scalability_launcher.py @@ -128,6 +128,8 @@ class ScalabilityLauncher(object): else: # Here call a runScalabilityTest ( placed on product/ERP5Type/tests ) ? self.log("Test Case %s is running..." %(current_test.title)) + time.sleep(5) + self.log("Test Case %s is finish" %(current_test.title)) current_test.stop() self.log("Test Case Stopped") diff --git a/erp5/util/taskdistribution/__init__.py b/erp5/util/taskdistribution/__init__.py index cf3a0ba06bf7bb2ceed109c5a3e7e800e11095a3..3bc3bca5f579de4aae91ff93d5ee063137958237 100644 --- a/erp5/util/taskdistribution/__init__.py +++ b/erp5/util/taskdistribution/__init__.py @@ -378,6 +378,18 @@ class TestResultProxy(RPCRetry): if self._watcher_thread is not None: self._watcher_thread.join() + def stop(self): + """ + + """ + return self._retryRPC('stopTest', [self._test_result_path]) + + def fail(self): + """ + + """ + return self._retryRPC('failTest', [self._test_result_path]) + class TestResultProxyProxy(TestResultProxy): """ A wrapper/proxy to TestResultProxy @@ -413,6 +425,7 @@ class TestResultProxyProxy(TestResultProxy): """ return self._retryRPC('stopTestCase', [test_result_line_path]) + diff --git a/erp5/util/testnode/ScalabilityTestRunner.py b/erp5/util/testnode/ScalabilityTestRunner.py index a9fa7b7c388a671c91cc85bdb1eebf8f911a68bf..37936ad0f58dbebd692091183345dfbf5f5d28a6 100644 --- a/erp5/util/testnode/ScalabilityTestRunner.py +++ b/erp5/util/testnode/ScalabilityTestRunner.py @@ -301,41 +301,58 @@ late a SlapOS (positive) answer." %(str(os.getpid()),str(os.getpid()),)) exclude_list=[x for x in test_list if x!=test_list[count]] count += 1 test_result_line_proxy = test_result_proxy.start(exclude_list) + + # Possible ? : # No more test to run if test_result_line_proxy == None : - # Hum normal ? self.log("Already tested.") - # Clean up - return {'status_code' : 0} + error = ValueError("Test already tested.") + break; + self.log("Test for count : %d is in a running state." %count) while test_result_line_proxy.isRunning() and test_result_proxy.isAlive(): time.sleep(15) pass + + # Check test case state if test_result_line_proxy.isCompleted(): - self.log("Test completed.") - pass + self.log("Test case completed.") + error = None elif not test_result_proxy.isAlive(): self.log("Test cancelled.") # Here do somethig with instances - raise ValueError("Test cancelled") + error = ValueError("Test cancelled") + break; elif test_result_line_proxy.isFailed(): self.log("Test failed.") # Here do somethig with instances - raise ValueError("Test failed") + error = ValueError("Test failed") + break; elif test_result_line_proxy.isCancelled(): self.log("Test cancelled.") # Here do somethig with instances - raise ValueError("Test has been cancelled") + error = ValueError("Test has been cancelled") + break; elif test_result_line_proxy.isRunning(): self.log("Test always running after max time elapsed.") # Here do somethig with instances - raise ValueError("Max time for this test case is elapsed.") + error = ValueError("Max time for this test case is elapsed.") + break; else: self.log("Test in a undeterminated state.") - raise ValueError("Test case is in an undeterminated state") + error = ValueError("Test case is in an undeterminated state") + break; + + + # Here delete intances + + if error != None: + test_result_proxy.fail() + raise error + else: + test_result_proxy.stop() - # todo : something like test_result_line_proxy.stop() return {'status_code' : 0} def _cleanUpNodesInformation(self):