From d30effc0ad7bdc0ca6b251e2de6ff401b9d0c806 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 0af8e3d0207..512fc0555d0 100644 --- a/tools/testClient/cloudstackConnection.py +++ b/tools/testClient/cloudstackConnection.py @@ -86,8 +86,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: @@ -96,9 +97,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", "")