Originally reported on Google Code with ID 34
I have an enhancement request to make tests run in parallel. I like Spock
so much, I'm using it to run some validation tests that run over a large
dataset. I use the data provider way and @Unroll to run the tests as unique
tests. They work great, except they run serially and I'd like to use up all
the cores that the machine has (> 4).
Reported by senthilvasan on 2009-07-17 21:42:40
Parallel test execution is definitely on our list. Is it important for you to run a
single method in parallel, our
would the ability to run different methods or classes in parallel be equally effective
for you?
Reported by pniederw on 2009-07-18 00:53:54
In the specific case I mentioned, having the ability for the single method to run in
parallel is more effective since it is called multiple times (many hundreds) using
@Unroll.
Thanks for a great product!
-Senthil.
Reported by senthilvasan on 2009-07-20 06:31:47
Thanks for your feedback!
Reported by pniederw on 2009-07-25 13:49:28
AcceptedReported by pniederw on 2009-10-28 00:50:59
Reported by pniederw on 2010-07-19 22:17:56
Reported by pniederw on 2010-11-25 05:31:24
Any updates regarding this issue?
Reported by [email protected] on 2013-03-04 02:27:44
I got it managed to run the tests in parallel with JUnit and Maven, but it is not a
nice solution. It would be nice if Spock offers something or TestNG instead of JUnit
can be used (parallelization works like charm there)
Reported by Sven.Ruchti on 2013-04-09 12:53:00
Can you elaborate on "it is not a nice solution"?
Reported by pniederw on 2013-04-09 13:29:24
I used maven for doing this, but the are problems with the correct dependencies. Following
worked for me:
Spock: 0.7-groovy-2.0
JUnit 4.11
Selenium 2.31 (Tried to do parallel testing with it)
Problem is here the surefire plugin from maven:
2.11 it works with
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.11</version>
<dependencies>
<!--SPOCK This is to force to use JUnit 4.7+ Runner -->
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit47</artifactId>
<version>2.11</version>
</dependency>
</dependencies>
<configuration>
<includes>
<!--SPOCK -->
<include>**/*Spec.java</include>
</includes>
<!-- Surefire 2.13 and below configuration for parallelization-->
<parallel>classes</parallel>
<threadCount>3</threadCount>
<perCoreThreadCount>true</perCoreThreadCount>
<useUnlimitedThreads>false</useUnlimitedThreads>
</configuration>
</plugin>
Everything beyond 2.11 of surefire doesn`t work. I always get exceptions.
For Surefire 2.14 config for parallelization has changed to:
<configuration>
<forkCount>5</forkCount>
<reuseForks>false</reuseForks>
</configuration>
Reported by Sven.Ruchti on 2013-04-11 05:38:29
What exact exception(s) do you get?
Reported by pniederw on 2013-04-11 05:40:44
More info here on stack-overflow
http://stackoverflow.com/questions/15526510/junit-maven-parallel-test-execution-error
Reported by Sven.Ruchti on 2013-04-11 15:58:54
Any update on this? We're using gradle, and adding in the maxParallelForks option doesn't
seem to solve this issue in the same way that it seemed to for the maven user above.
Reported by sgentry6 on 2013-05-29 20:55:48
It seems our issue was due to having overridden the default test task. Once we removed
that, things worked as expected.
Reported by sgentry6 on 2013-05-30 14:04:25
One thing that's not possible currently is to have multiple iterations of a data-driven
feature run on multiple threads.
I have a Spec with a single feature that is run with about 200 different configurations.
The feature has an @Unroll annotation, but I don't think that it makes a difference.
Reported by fooberger on 2014-11-27 14:47:30
I can see this issue is still open and there is no mention of parallel execution in the official docs. When can the community expect this issue to be addressed? For those who use Spock for something else than unit testing this would be an important improvement. It would be a shame if lack of this feature would make people look for alternatives.
This would be really helpful, especially (as in my case) when each iteration of a data-driven feature takes a couple of minutes to run.
Running though surefire is a wordaround for parallel now.
That would be a great idea to have it support parallel testing, especially for data-driven test cases.
It would by even better if it can be controlled by annotation like @Unroll, @Parallel.
Related PR - #558.
Hi!
I'm using Gradle + Spock in my project for writing integration tests. At this stage, the test suite is running for about an hour and it's pretty slow ;( So to speed it up our my team decided to use tests parallelization. Gradle supports parallel tests execution, but only with help of forks and in this way I'm limited with the number of cores on my machine (or even less).
Is there any terms or plans to add parallel tests execution to Spock?
Hi!
I'm using Gradle + Spock in my project for writing integration tests. At this stage, the test suite is running for about an hour and it's pretty slow ;( So to speed it up our my team decided to use tests parallelization. Gradle supports parallel tests execution, but only with help of forks and in this way I'm limited with the number of cores on my machine (or even less).
Is there any terms or plans to add parallel tests execution to Spock?
Hi!
I'm using Gradle + Spock in my project for writing integration tests. At this stage, the test suite is running for about an hour and it's pretty slow ;( So to speed it up our my team decided to use tests parallelization. Gradle supports parallel tests execution, but only with help of forks and in this way I'm limited with the number of cores on my machine (or even less).
Is there any terms or plans to add parallel tests execution to Spock?
gradle.properties:
org.gradle.workers.max=10
maxparellelforks=10
build.gradle:
test {
maxParallelForks = project.maxparellelforks as int
}
It will work can you try this one. Make sure none other program should not run on your machine because while creating setting or creating workers gradle will consume more cpu once created, will release cpu.
Hi @automatictester , @gkastrinis , @dengayevskiy , @arjunankaruppusamy & anyone else who thirsts for parallel execution in Spock.
Please consider directing your attention to Support for parallel feature and iteration execution (Pull request #588).
As far as I can tell, this feature has been implemented - but requires testing and review - before it's released :-D
Some of you appear to have access to Spock test-suites that would be perfect for some real world testing of the PR-branch.
Perhaps @Fuud or a maintainer could provide a Spock SNAPSHOT-binary or guidance/howto generate a local binary for testing.
DO we know when will this feature be released ? we can help testing too, if it will be helpful.
Adding my +1 to get parallel execution
Spock 2.0 will support parallel execution provided via the JUnit 5 Platform
@leonard84 that's great and all but this issue has been open for 3.5 years. Do we have a rough estimate as to when Spock 2.0 is coming? You also said something similar in another issue 6 months ago:
Sorry but this will not be merged into Spock 1.x. Spock 2.0 will use the native support from the JUnit > 5 Plattform for parallel execution.
_Originally posted by @leonard84 in > https://github.com/spockframework/spock/pull/558#issuecomment-417375642_
Spock is on 1.3 at the moment, so it seems 2.0 seems way out on the horizon. I know that isn't how versions work, but we don't have any better indication.
Spock is on 1.3 at the moment, so it seems 2.0 seems way out on the horizon.
No, 1.3 is the last planned 1.x release. We have already started with the development for 2.0 https://github.com/spockframework/spock/tree/spock-2.0
That is very nice to hear. Thank you for the update.
On Wed, Feb 13, 2019, 12:54 PM Leonard Brünings <[email protected]
wrote:
Spock is on 1.3 at the moment, so it seems 2.0 seems way out on the
horizon.No, 1.3 is the last planned 1.x release. We have already started with the
development for 2.0 https://github.com/spockframework/spock/tree/spock-2.0—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/spockframework/spock/issues/157#issuecomment-463321383,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AhVMyW1YapQffxHs1s4yNx1lYvyzNSazks5vNF-CgaJpZM4KvpFQ
.
Does the snapshot spock-core-2.0-groovy-2.5 support parallel for @Unroll now? Seems it can't work in my case. Or is there some configuration to turn it on?
Not yet, but Leonard is working on it at #1207.
Not yet, but Leonard is working on it at #1207.
Thanks. So when could this be fixed even in snapshot? If it takes a long time, is there a workaround for this?
@Carmen123456789 we are currently waiting on the JUnit 5.7-M2 release, which should be out this Friday. After that I hope to get it finished this month. There is currently no workaround.
@Carmen123456789 we are currently waiting on the JUnit 5.7-M2 release, which should be out this Friday. After that I hope to get it finished this month. There is currently no workaround.
Thanks! Looking foward to it!
@Carmen123456789 we are currently waiting on the JUnit 5.7-M2 release, which should be out this Friday. After that I hope to get it finished this month. There is currently no workaround.
Hi @leonard84, any updates on this?
@roma0297 I'm waiting on a code review but you can check out the branch and give early feedback.
Most helpful comment
I can see this issue is still open and there is no mention of parallel execution in the official docs. When can the community expect this issue to be addressed? For those who use Spock for something else than unit testing this would be an important improvement. It would be a shame if lack of this feature would make people look for alternatives.