Closed kawalbhatia closed 3 years ago
@kawalbhatia The CreateProcess error=206
is a limitation in Windows operating systems that causes Courgette to fail when the class path exceeds the command length.
I just released Courgette version 5.9.2
which includes a new Courgette option classPath
which should workaround this Windows limitation.
Refer to the example project here: https://github.com/prashant-ramcharan/courgette-jvm-classpath-example
@prashant-ramcharan _ i tried using the classpath option. It is giving this error : I have used the plugin to copy the dependencies in target/lib folder.
Corrupted STDOUT by directly writing to native stream in forked JVM 1. Stream 'Error: Could not find or load main class io.cucumber.core.cli.Main'.
java.lang.IllegalArgumentException: Stream stdin corrupted. Expected comma after third character in command 'Error: Could not find or load main class io.cucumber.core.cli.Main'.
at org.apache.maven.plugin.surefire.booterclient.output.ForkClient$OperationalData.
This suggests that you may have incorrectly configured the classpath.
Please see the example project on how to configure it correctly.
Can you paste your runner and pom.xml here?
Hi @prashant-ramcharan ,
Please find below the runner file I am using. And also attached is the pom.xml file ( attaching zip format as it is not allowing directly)
package paralelrunner;
import courgette.api.CourgetteOptions; import courgette.api.CourgetteRunLevel; import courgette.api.CucumberOptions; import courgette.api.testng.TestNGCourgette;
import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeSuite; import org.testng.annotations.Test;
import com.cucumber.uvs.ecom.helper.reporter.ReporterUtil; import com.cucumber.uvs.ecom.test.stepdefinition.BaseStepClass;
@Test @CourgetteOptions( threads = 3, runLevel = CourgetteRunLevel.FEATURE, rerunFailedScenarios = false, showTestOutput = true, reportTargetDir = "build", classPath = {"target/libs/*", "target/test-classes/"}, reportTitle = "Test - Automation Report", // environmentInfo = "browser=chrome; git_branch=master; project_info=Courgette-JVM is awesome!", plugin = "com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter:", cucumberOptions = @CucumberOptions(features = "src/test/resources/featurefile", glue = { "classpath:com.cucumber.uvs.ecom.test.stepdefinition", "classpath:com.cucumber.uvs.ecom.helper" }, plugin = { "pretty", "json:target/UVSEComm.json", "com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter:" }, monochrome = true, tags = "@RegressionGUItest"))
public class FeatureSuite extends TestNGCourgette {
@AfterClass(alwaysRun = true)
public static void writeExtentReport() {
ReporterUtil.archiveReport();
}
@BeforeSuite(alwaysRun = true)
public static void getEnvDetails() {
BaseStepClass.env=System.getProperty("env");
}
}
Can you see all the project libs (jar files) in the target/libs
directory before running the tests?
You should try running the copy-dependencies
maven goal first.
And do you get the same error when running this: https://github.com/prashant-ramcharan/courgette-jvm-classpath-example/tree/master/courgette-jvm-maven
Hi @prashant-ramcharan , Thanks for looking in to it . I checked both the things mentioned by you .
Corrupted STDOUT by directly writing to native stream in forked JVM 1. Stream '@example'.
java.lang.IllegalArgumentException: Stream stdin corrupted. Expected comma after third character in command '@example'.
at org.apache.maven.plugin.surefire.booterclient.output.ForkClient$OperationalData.
Can you try running the Courgette runner directly? Not using the maven-surefire-plugin
?
Also confirm the following:
Hi @prashant-ramcharan ,
I executed the https://github.com/prashant-ramcharan/courgette-jvm-classpath-example/tree/master/courgette-jvm-maven directly using runner file without maven-surefire plugin and it worked like a charm without any error.
Also find below other details as required :
Operating system : Windows 10 pro Maven version : Apache Maven 3.6.3 Java version : 1.8.0_251
That's great @kawalbhatia
I assume you running the maven tests from IntelliJ or Eclipse?
Can you try running mvn test
from a separate command line program and not from IntelliJ or Eclipse?
Hi @prashant-ramcharan - Tried running mvn test from command line . Getting the same error while executing through mvn test .
Ok to go back to the original issue which is the CreateProcess error=206
, can you verify this works fine in your main project when running the Courgette runner directly?
If not, please share a project I can use.
Hi @prashant-ramcharan , I hope you are referring to original issue i was getting with version 5.9.1 of Courgette library.
Please find attached the sample project , if we run using maven(mv test) on windows, it gives the java.io.IOException: Cannot run program "java": CreateProcess error=206, The filename or extension is too long.
We have two test runner file here :
Please let me know in case more details are required. ParallelExecution.zip
Thanks @kawalbhatia - will take a look.
@kawalbhatia I ran your project on a Windows machine and I don't get the Create Process 206 error.
I also had to update your Courgette runner and pom file to make it work. Your plugins were incorrect and had missing deps. The runner now uses a custom class path as mentioned in my earlier comment.
See updated project attached: UPDATED_ParallelExecution.zip
Here is the video: https://recordit.co/Rfk3VqU38o (Windows 10 + Maven + Java 8)
Hi @prashant-ramcharan - Thanks very much for looking in to it . Not sure why it was not working earlier .But now with the changes you shared, it is working fine. Thanks again . We can close this ticket.
Getting the error : java.io.IOException: Cannot run program "java": CreateProcess error=206, The filename or extension is too long
I am using Maven to build and test . when i am executing the runner file without Courgette option, it works well without any issue. However with Courgette option, it gives this error.
Tried following the steps in below link but not working: https://maven.apache.org/surefire/maven-surefire-plugin/examples/class-loading.html