cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Prasanna Santhanam <...@apache.org>
Subject Re: [DISCUSS] Multi-threading in test suite
Date Fri, 22 Feb 2013 06:45:14 GMT
On Thu, Feb 21, 2013 at 11:42:28PM +0530, Girish Shilamkar wrote:
> Hello,
> 
> We are automating the snapshot improvement tests cases [1] from the
> QA plans page. Some of the test scenarios there involve concurrent
> spawning of virtual machines, creating snapshots on ROOT disk and
> live migrating machines to another host while snapshot process is in
> progress.

Thanks for bringing this to the list. The wiki you cited is not within
Apache and cannot be viewed by folks in the community, can you help
move it to the test plans page [1]? 

Also Can you spell out the test scenario? 

CloudStack already deploys VMs in async, so you don't have to do your
own threading within the test. So even on the UI the deployment just
goes into different jobs. By default marvin polls for job finish
before returning - pollAsync is a blocking call.

However you can submit asyncjobs in a group to marvin through the
submitAsyncJobs method in the asyncJobMgr. You could monitor the
concurrency using a better abstraction like a queue [2]. Threading
within a test suite is better avoided. Let me know the test and
may be we can enhance marvin to automate such a scenario.

[1] https://cwiki.apache.org/confluence/display/CLOUDSTACK/Test+Plans
[2] http://blog.doughellmann.com/2007/04/pymotw-queue.html

PS: You guys are working on github? Can you let me know the github
repo so I can pull in tests from there for review and runs?

-- 
Prasanna.,

> 
> We are trying to automate the scenario by creating multiple threads within
> a test case. This is achieved by creating a thread class within a test
> suite and initializing constructors of base class.
> 
> 
> 
> class createThread(threading.Thread, cloudstackTestCase):
> 
>     def __init__(self, target, *args):
> 
>         self._target = target
> 
>         self._args = args
> 
>         threading.Thread.__init__(self)
> 
>         cloudstackTestCase.__init__(self, args)
> 
>     def run(self):
> 
>         self._target(*self._args)
> 
> 
> 
> The problem here is creating a new thread doesn't inherit logger other
> objects from the main thread and logs all errors/exceptions console. Using
> main thread's logging would either require to collect and send messages to
> main thread via messagequeue or initializing loggers again in createThread
> class. Is it fine to do so in a test suite? Or multi-threading should be
> incorporated within marvin framework. Also, can you think of any better way
> to implement this?
> 
> 
> 
> Please let me know your thoughts.
> 
> 
> 
> [1]
> http://confluence.cloudstack.org/display/QA/Snapshots+Improvements+Test+cases
> 
> 
> Regards,
> 
> Girish


Mime
View raw message