Parallel execution in maven project

476 views
Skip to first unread message

pavel

unread,
Mar 28, 2016, 9:19:37 AM3/28/16
to getgauge
1) Can't launch parallel execution. I tried it like this:
mvn gauge:execute -DinParallel=true

and also tried to add to maven plugin configuration
<inParallel>true</inParallel>

in both cases I see that specs are run sequentially - not in parallel, as expected.

2) Are parallel tests limited to parallel specs? Can I run parallel scenarios?

Mahendra Kariya

unread,
Mar 28, 2016, 9:32:32 AM3/28/16
to getgauge
Hi Pavel,

You should be able to run Gauge specs in parallel with either of the methods above. It's really weird that Gauge is not running in parallel. Could you please send us the relevant logs? You should be able to get detailed logs by adding -X flag to mvn command.

As a workaround, could you also try passing -p in flags (-Dflags="-p") and give it a shot?

Gauge only runs specs in parallel, and not scenarios.





--
You received this message because you are subscribed to the Google Groups "getgauge" group.
To unsubscribe from this group and stop receiving emails from it, send an email to getgauge+u...@googlegroups.com.
To post to this group, send email to getg...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/getgauge/93d1f3ce-fb1e-4d84-9183-9fb87ec17772%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

pavel

unread,
Mar 28, 2016, 9:54:31 AM3/28/16
to getgauge
Works with -Dflags="-p"

понедельник, 28 марта 2016 г., 16:32:32 UTC+3 пользователь Mahendra Kariya написал:

Mahendra Kariya

unread,
Mar 28, 2016, 10:03:58 AM3/28/16
to getgauge
Glad to know it works with -Dflags.

Ideally it should even work with -DinParallel. We use this flag (pom.xml#L50) in Gauge functional tests (which are written in Gauge) and it's working fine for us.

So it would be great if you could still send us the logs. That will help us investigate what's wrong.
Please also include the OS/arch of your machine along with the output of gauge -v.



pavel

unread,
Mar 28, 2016, 10:37:51 AM3/28/16
to getgauge
OK, the problem is somewhere deeper. I've actually forgotten to mention about this error:

17:30:04.605 u: [WARN]         org.reflections.Reflections:     could not create Dir using com.thoughtworks.gauge.scan.ClasspathScanner$1@4a5755ed from url file:/Users/pavelp/zt/pcm-tests/target/classes. skipping.
java.lang.NullPointerException: null
        at com.thoughtworks.gauge.scan.ClasspathScanner$1.createDir(ClasspathScanner.java:53) ~[gauge-java-0.3.4.jar:na]
        at org.reflections.vfs.Vfs.fromURL(Vfs.java:99) [reflections-0.9.10.jar:na]
        at org.reflections.vfs.Vfs.fromURL(Vfs.java:91) [reflections-0.9.10.jar:na]
        at org.reflections.Reflections.scan(Reflections.java:237) [reflections-0.9.10.jar:na]
        at org.reflections.Reflections.scan(Reflections.java:204) [reflections-0.9.10.jar:na]
        at org.reflections.Reflections.<init>(Reflections.java:129) [reflections-0.9.10.jar:na]
        at com.thoughtworks.gauge.scan.ClasspathScanner.createReflections(ClasspathScanner.java:60) [gauge-java-0.3.4.jar:na]
        at com.thoughtworks.gauge.scan.ClasspathScanner.scan(ClasspathScanner.java:37) [gauge-java-0.3.4.jar:na]
        at com.thoughtworks.gauge.GaugeRuntime.main(GaugeRuntime.java:36) [gauge-java-0.3.4.jar:na]
17:30:04.607 u: [WARN]         org.reflections.Reflections:     could not create Dir using directory from url file:/Users/pavelp/zt/pcm-tests/target/classes. skipping.
java.lang.NullPointerException: null
        at org.reflections.vfs.Vfs$DefaultUrlTypes$3.matches(Vfs.java:239) ~[reflections-0.9.10.jar:na]
        at org.reflections.vfs.Vfs.fromURL(Vfs.java:98) [reflections-0.9.10.jar:na]
        at org.reflections.vfs.Vfs.fromURL(Vfs.java:91) [reflections-0.9.10.jar:na]
        at org.reflections.Reflections.scan(Reflections.java:237) [reflections-0.9.10.jar:na]
        at org.reflections.Reflections.scan(Reflections.java:204) [reflections-0.9.10.jar:na]
        at org.reflections.Reflections.<init>(Reflections.java:129) [reflections-0.9.10.jar:na]
        at com.thoughtworks.gauge.scan.ClasspathScanner.createReflections(ClasspathScanner.java:60) [gauge-java-0.3.4.jar:na]
        at com.thoughtworks.gauge.scan.ClasspathScanner.scan(ClasspathScanner.java:37) [gauge-java-0.3.4.jar:na]
        at com.thoughtworks.gauge.GaugeRuntime.main(GaugeRuntime.java:36) [gauge-java-0.3.4.jar:na]
17:30:04.608 u: [WARN]         org.reflections.Reflections:     could not create Vfs.Dir from url. ignoring the exception and continuing
org.reflections.ReflectionsException: could not create Vfs.Dir from url, no matching UrlType was found [file:/Users/pavelp/zt/pcm-tests/target/classes]
either use fromURL(final URL url, final List<UrlType> urlTypes) or use the static setDefaultURLTypes(final List<UrlType> urlTypes) or addDefaultURLTypes(UrlType urlType) with your specialized UrlType.
        at org.reflections.vfs.Vfs.fromURL(Vfs.java:109) ~[reflections-0.9.10.jar:na]
        at org.reflections.vfs.Vfs.fromURL(Vfs.java:91) ~[reflections-0.9.10.jar:na]
        at org.reflections.Reflections.scan(Reflections.java:237) [reflections-0.9.10.jar:na]
        at org.reflections.Reflections.scan(Reflections.java:204) [reflections-0.9.10.jar:na]
        at org.reflections.Reflections.<init>(Reflections.java:129) [reflections-0.9.10.jar:na]
        at com.thoughtworks.gauge.scan.ClasspathScanner.createReflections(ClasspathScanner.java:60) [gauge-java-0.3.4.jar:na]
        at com.thoughtworks.gauge.scan.ClasspathScanner.scan(ClasspathScanner.java:37) [gauge-java-0.3.4.jar:na]
        at com.thoughtworks.gauge.GaugeRuntime.main(GaugeRuntime.java:36) [gauge-java-0.3.4.jar:na]
17:30:06.007 u: [INFO]         org.reflections.Reflections:     Reflections took 5131 ms to scan 228 urls, producing 11890 keys and 60923 values 
Executing in 2 parallel streams.


I'see it's expecting this classes folder for some reason? At least it is running in parallel with -DinParallel=true, but these errors are driving me mad. Anyways, I created this  folder target/classes manually and not getting the error anymore, at the same time I'm not able to run specs in parallel, unless I specify the cli flag..

понедельник, 28 марта 2016 г., 17:03:58 UTC+3 пользователь Mahendra Kariya написал:

pavel

unread,
Mar 28, 2016, 11:03:40 AM3/28/16
to getgauge
Not sure what helped eventually. I created manually the "classes" folder under target and I also used -U flag with maven. Currently -DinParallel=true is working as expected. I'm clueless.

William Penado

unread,
Feb 12, 2019, 3:08:28 PM2/12/19
to getgauge
Hey Mahendra,

I actually checked your POM.xml file and added/updated some dependencies, properties, etc. And it finally worked for me.
For some reason, the plugin seems to be failing, but if you execute from maven the command line: mvn test.
It will execute all the tests.

Thanks for the support.
Reply all
Reply to author
Forward
0 new messages