Skip to content
This repository has been archived by the owner on Mar 18, 2019. It is now read-only.

Rerun failing test case fails with exception "Unable to create test class" #126

Closed
halfo opened this issue Jun 21, 2017 · 2 comments
Closed

Comments

@halfo
Copy link

halfo commented Jun 21, 2017

I'm trying to rerun the failing test cases using surefire plugin. When trying to rerun the failing test cases, looks like it is trying to create class with wrong class name Unable to create test class 'Scenario: Successful Logout'. I'm using feature-title as namingScheme.

Exception message:

Please refer to dump files (if any exist) [date]-jvmRun[N].dump, [date].dumpstream and [date]-jvmRun[N].dumpstream.
ExecutionException There was an error in the forked process
Unable to create test class 'Scenario: Successful Logout'
org.apache.maven.surefire.booter.SurefireBooterForkException: ExecutionException There was an error in the forked process
Unable to create test class 'Scenario: Successful Logout'
        at org.apache.maven.plugin.surefire.booterclient.ForkStarter.awaitResultsDone(ForkStarter.java:494)
        at org.apache.maven.plugin.surefire.booterclient.ForkStarter.runSuitesForkOnceMultiple(ForkStarter.java:369)
        at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:292)
        at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:243)
        at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1077)
        at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:907)
        at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:785)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process
Unable to create test class 'Scenario: Successful Logout'
        at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:665)
        at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:533)
        at org.apache.maven.plugin.surefire.booterclient.ForkStarter.access$600(ForkStarter.java:117)
        at org.apache.maven.plugin.surefire.booterclient.ForkStarter$1.call(ForkStarter.java:363)
        at org.apache.maven.plugin.surefire.booterclient.ForkStarter$1.call(ForkStarter.java:342)
        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)

maven-surefire-plugin configuration:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.20</version>
    <configuration>
        <additionalClasspathElements>
            <additionalClasspathElement>src/test/resources</additionalClasspathElement>
        </additionalClasspathElements>
        <includes><include>**/*IT.class</include></includes>
        <forkCount>2</forkCount>
        <reuseForks>true</reuseForks>
        <testFailureIgnore>true</testFailureIgnore>
        <rerunFailingTestsCount>2</rerunFailingTestsCount>
    </configuration>
    <dependencies>
        <dependency>
            <groupId>org.apache.maven.surefire</groupId>
            <artifactId>surefire-junit47</artifactId>
            <version>2.20</version>
        </dependency>
    </dependencies>
</plugin>
@mpkorstanje
Copy link
Collaborator

This is caused by a nice pair of bugs between cucumber-jvm and surefire.

I recently pushed a fix to cucumber which will be released once 2.0.0 is done. No time table for that: cucumber/cucumber-jvm#1134.

The Surefire one is still a work in progress: apache/maven-surefire#150.

See also: #31.

@halfo
Copy link
Author

halfo commented Jun 22, 2017

Looks like I'm out of luck now. BTW thank for the info and real quick reply. Cheers!

P.S. as this is a duplicate, I'm closing it.

@halfo halfo closed this as completed Jun 22, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants