From b013fb3107ff2f0b3f532a671de1bfeb71f9cf1a Mon Sep 17 00:00:00 2001 From: Prasanna Santhanam Date: Wed, 4 Apr 2012 16:31:17 +0530 Subject: [PATCH] bug 14608: Async timeout counter does not get reset across tests status 14608: resolved fixed reviewed-by: Chirag Jog (chirag@clogeny.com) Set the timeout countdown to start from beginning of each pollAsync instead of setting it once for the entire run. --- tools/testClient/cloudstackConnection.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/testClient/cloudstackConnection.py b/tools/testClient/cloudstackConnection.py index 84c60c71383..b72e54c3c10 100644 --- a/tools/testClient/cloudstackConnection.py +++ b/tools/testClient/cloudstackConnection.py @@ -97,8 +97,9 @@ class cloudConnection(object): def pollAsyncJob(self, jobId, response): cmd = queryAsyncJobResult.queryAsyncJobResultCmd() cmd.jobid = jobId + timeout = self.asyncTimeout - while self.asyncTimeout > 0: + while timeout > 0: asyncResonse = self.make_request(cmd, response, True) if asyncResonse.jobstatus == 2: @@ -107,9 +108,10 @@ class cloudConnection(object): return asyncResonse time.sleep(5) - self.asyncTimeout = self.asyncTimeout - 5 + self.logging.debug("job: %s still processing, will timeout in %ds"%(jobId, timeout)) + timeout = timeout - 5 - raise cloudstackException.cloudstackAPIException("asyncquery", "Async job timeout") + raise cloudstackException.cloudstackAPIException("asyncquery", "Async job timeout %s"%jobId) def make_request(self, cmd, response = None, raw=False): commandName = cmd.__class__.__name__.replace("Cmd", "")