From 6c30535bb2d38b315b5387e4a6c74d5f241260ad Mon Sep 17 00:00:00 2001 From: Benjamin Blanc <benjamin.blanc@tiolive.com> Date: Mon, 9 Sep 2013 15:46:18 +0200 Subject: [PATCH] testnode: stop instance and fail test when instanciation is too long --- erp5/util/testnode/ScalabilityTestRunner.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/erp5/util/testnode/ScalabilityTestRunner.py b/erp5/util/testnode/ScalabilityTestRunner.py index 16404ab4fb..ad8e441ef8 100644 --- a/erp5/util/testnode/ScalabilityTestRunner.py +++ b/erp5/util/testnode/ScalabilityTestRunner.py @@ -228,7 +228,16 @@ late a SlapOS (positive) answer." %(str(os.getpid()),str(os.getpid()),)) self.log("Instance(s) not in %s state yet." % state) time.sleep(15) if (time.time()-start_time) > max_time: - raise ValueError("Instance '%s' not '%s' after %s seconds" %(instance_title, state, str(time.time()-start_time))) + error_message = "Instance '%s' not '%s' after %s seconds" %(instance_title, state, str(time.time()-start_time)) + self.log(error_message) + self.log("Do you use instance state propagation in your project?") + self.log("Instance '%s' will be stopped and test avorted." %instance_title) + # What if we wanted to stop ? + self.slapos_controler.stopInstance(instance_title) + # XXX: _waitInstance call here ? recursive call ? + # XXX: sleep 60 seconds. + time.sleep(60) + raise ValueError(error_message) self.log("Instance correctly '%s' after %s seconds." %(state, str(time.time()-start_time))) def _waitInstanceCreation(self, instance_title, max_time=MAX_CREATION_INSTANCE_TIME): -- 2.30.9