Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-threading for python #121

Open
iallen7 opened this issue Nov 6, 2018 · 6 comments
Open

Multi-threading for python #121

iallen7 opened this issue Nov 6, 2018 · 6 comments

Comments

@iallen7
Copy link

iallen7 commented Nov 6, 2018

Currently parallel execution using multi-threading for python is unsupported. Would like to see this supported in python as outlined in the 'parallel execution using threads' part of documentation:

capture

@gaugebot gaugebot bot added the community label Nov 6, 2018
@pmcphailWAT
Copy link

This feature would be beneficial for testing embedded systems. Without the ability to use multi-threading for parallel execution we are severely limited to the number of tests we can run at a time. We run regression testing on 12+ control boards at a time from one computer and it looks like this is currently not possible if using python.

@AkaAnto
Copy link

AkaAnto commented Feb 5, 2019

I am facing the same issue, I have 240 test cases and it takes 6+ hours to run cause I can use parallel execution

@NivedhaSenthil
Copy link
Member

Since python(cPython implementation) multithreading does not allow to run more than one thread at a time, we will not be able to utilise the full capacity of CPU cores. And thus not very suitable for computationally intensive processes. Refer for more discussions.

Currently gauge-python spawns multiple process based on CPU cores available to parallelise the execution.

@AkaAnto have you tried running specs in parallel ?

@AkaAnto
Copy link

AkaAnto commented Feb 6, 2019

I have with no luck, process spawns but I am facing a race condition. I am currently working on making all of my code thread safe to give it another try. I ll let you know how it goes

@AkaAnto
Copy link

AkaAnto commented Feb 7, 2019

I was able to run test in parallel @NivedhaSenthil. Race condition arise from time to time when using more than 3 process. This is a known bug for python 2.7. In a non related issue, any hook or way of knowing when all suites/test finished running ?

@NivedhaSenthil
Copy link
Member

@after_suite hook should say that all the suite is executed and any action to be performed after suites completion can be done here. https://docs.gauge.org/latest/writing-specifications.html#id11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

5 participants