allure-framework / allure-cucumberjvm

Deprecated, use https://github.com/allure-framework/allure-java instead
Apache License 2.0
16 stars 13 forks source link

Multithread execution configured by maven-surefire-plugin parallel option fails #9

Closed GreenTeaCake closed 9 years ago

GreenTeaCake commented 9 years ago

Enabling parallel configuration for maven-surefire-plugin causes an error.

Config

    <build>
            ...
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                ...
                <configuration>
                   ...
                    <parallel>classes</parallel>
                    <threadCount>8</threadCount>
                    <includes>
                        <include>**/runners/*.java</include>
                    </includes>
                </configuration>
                ...
            </plugin>
        </plugins>
    </build>

Stacktrace

Test mechanism  Time elapsed: 0.001 sec  <<< ERROR!
java.lang.ArrayIndexOutOfBoundsException: 1
    at ru.yandex.qatools.allure.cucumberjvm.AllureRunListener.testSuiteStarted(AllureRunListener.java:93)
    at ru.yandex.qatools.allure.cucumberjvm.AllureRunListener.getSuiteUid(AllureRunListener.java:225)
    at ru.yandex.qatools.allure.cucumberjvm.AllureRunListener.testStarted(AllureRunListener.java:170)
    at org.junit.runner.notification.RunNotifier$3.notifyListener(RunNotifier.java:115)
    at org.junit.runner.notification.RunNotifier$SafeNotifier.run(RunNotifier.java:61)
    at org.junit.runner.notification.RunNotifier.fireTestStarted(RunNotifier.java:112)
    at org.junit.internal.runners.model.EachTestNotifier.fireTestStarted(EachTestNotifier.java:43)
    at cucumber.runtime.junit.JUnitReporter.result(JUnitReporter.java:95)
    at cucumber.runtime.Runtime.runStep(Runtime.java:308)
    at cucumber.runtime.model.StepContainer.runStep(StepContainer.java:44)
    at cucumber.runtime.model.StepContainer.runSteps(StepContainer.java:39)
    at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:48)
    at cucumber.runtime.junit.ExecutionUnitRunner.run(ExecutionUnitRunner.java:91)
    at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:63)
    at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:18)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
    at cucumber.runtime.junit.FeatureRunner.run(FeatureRunner.java:70)
    at cucumber.api.junit.Cucumber.runChild(Cucumber.java:93)
    at cucumber.api.junit.Cucumber.runChild(Cucumber.java:37)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
    at org.apache.maven.surefire.junitcore.pc.Scheduler$1.run(Scheduler.java:387)
    at org.apache.maven.surefire.junitcore.pc.InvokerStrategy.schedule(InvokerStrategy.java:54)
    at org.apache.maven.surefire.junitcore.pc.Scheduler.schedule(Scheduler.java:346)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
    at cucumber.api.junit.Cucumber.run(Cucumber.java:98)
    at org.junit.runners.Suite.runChild(Suite.java:127)
    at org.junit.runners.Suite.runChild(Suite.java:26)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
    at org.apache.maven.surefire.junitcore.pc.Scheduler$1.run(Scheduler.java:387)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)

Sample project:

cucumber-jvm-allure-multithread

Is parallel execution supported by allure-cucumber-ivm-adaptor?

vania-pooh commented 9 years ago

@grumblerchester thank you for the feedback. @clicman our Java API supports multithreaded execution. Please check that you're raising events in adapter in the same way we do with JUnit and TestNG.

clicman commented 9 years ago

@grumblerchester parallel execution was not tested yet. And seems to be not supported. @vania-pooh I`ll check it.

GreenTeaCake commented 9 years ago

Please provide milestone if it is possible.

clicman commented 9 years ago

@grumblerchester I found problem. And I tihnk I will resease new version on this weenends.

clicman commented 9 years ago

Fixed in version 1.3

GreenTeaCake commented 9 years ago

Gratz guys!