Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues when running in Parallel with TestNG #1480

Closed
ben-arce-hdz opened this issue Oct 15, 2018 · 6 comments
Closed

Issues when running in Parallel with TestNG #1480

ben-arce-hdz opened this issue Oct 15, 2018 · 6 comments

Comments

@ben-arce-hdz
Copy link

I have a suite of tests that are running perfectly in a Sequential way, when I try to run them in Parallel, is very unstable sometimes failed everything sending a NPE, or sometimes I get this message "gherkin.ast.Feature cannot be cast to gherkin.ast.ScenarioDefinition" for: scenarios, features, and for some reason it's failing in some scenarios where I am using Datatable

Using cucumber 4.0.1
image

Stacktrace:
java.lang.ClassCastException: gherkin.ast.Feature cannot be cast to gherkin.ast.ScenarioDefinition at cucumber.runtime.formatter.TestSourcesModel.getScenarioDefinition(TestSourcesModel.java:46) at cucumber.runtime.formatter.TestSourcesModel.getScenarioDefinition(TestSourcesModel.java:96) at cucumber.runtime.formatter.PrettyFormatter.printScenarioDefinition(PrettyFormatter.java:322) at cucumber.runtime.formatter.PrettyFormatter.handleTestStepStarted(PrettyFormatter.java:137) at cucumber.runtime.formatter.PrettyFormatter.access$200(PrettyFormatter.java:32) at cucumber.runtime.formatter.PrettyFormatter$5.receive(PrettyFormatter.java:72) at cucumber.runtime.formatter.PrettyFormatter$5.receive(PrettyFormatter.java:69) at cucumber.runner.AbstractEventPublisher.send(AbstractEventPublisher.java:45) at cucumber.runner.AbstractEventBus.send(AbstractEventBus.java:9) at cucumber.runner.TimeServiceEventBus.send(TimeServiceEventBus.java:3) at cucumber.runner.ThreadLocalRunnerSupplier$SynchronizedEventBus.send(ThreadLocalRunnerSupplier.java:90) at cucumber.runner.ThreadLocalRunnerSupplier$LocalEventBus.send(ThreadLocalRunnerSupplier.java:63) at cucumber.runner.TestStep.run(TestStep.java:45) at cucumber.runner.PickleStepTestStep.run(PickleStepTestStep.java:43) at cucumber.runner.TestCase.run(TestCase.java:44) at cucumber.runner.Runner.runPickle(Runner.java:40) at cucumber.api.testng.TestNGCucumberRunner.runScenario(TestNGCucumberRunner.java:68) at cucumber.api.testng.AbstractTestNGCucumberTests.runScenario(AbstractTestNGCucumberTests.java:22) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:108) at org.testng.internal.Invoker.invokeMethod(Invoker.java:669) at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:877) at org.testng.internal.TestMethodWithDataProviderMethodWorker.call(TestMethodWithDataProviderMethodWorker.java:71) at org.testng.internal.TestMethodWithDataProviderMethodWorker.call(TestMethodWithDataProviderMethodWorker.java:14) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)

Feature with Scenarios that use datatables
java.lang.ClassCastException: gherkin.ast.TableRow cannot be cast to gherkin.ast.Step at cucumber.runtime.formatter.PrettyFormatter.getStepKeyword(PrettyFormatter.java:260) at cucumber.runtime.formatter.PrettyFormatter.printStep(PrettyFormatter.java:204) at cucumber.runtime.formatter.PrettyFormatter.handleTestStepFinished(PrettyFormatter.java:145) at cucumber.runtime.formatter.PrettyFormatter.access$300(PrettyFormatter.java:32) at cucumber.runtime.formatter.PrettyFormatter$6.receive(PrettyFormatter.java:78) at cucumber.runtime.formatter.PrettyFormatter$6.receive(PrettyFormatter.java:75) at cucumber.runner.AbstractEventPublisher.send(AbstractEventPublisher.java:45) at cucumber.runner.AbstractEventBus.send(AbstractEventBus.java:9) at cucumber.runner.TimeServiceEventBus.send(TimeServiceEventBus.java:3) at cucumber.runner.ThreadLocalRunnerSupplier$SynchronizedEventBus.send(ThreadLocalRunnerSupplier.java:90) at cucumber.runner.ThreadLocalRunnerSupplier$LocalEventBus.send(ThreadLocalRunnerSupplier.java:63) at cucumber.runner.TestStep.run(TestStep.java:57) at cucumber.runner.PickleStepTestStep.run(PickleStepTestStep.java:43) at cucumber.runner.TestCase.run(TestCase.java:44) at cucumber.runner.Runner.runPickle(Runner.java:40) at cucumber.api.testng.TestNGCucumberRunner.runScenario(TestNGCucumberRunner.java:68) at cucumber.api.testng.AbstractTestNGCucumberTests.runScenario(AbstractTestNGCucumberTests.java:22) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:108) at org.testng.internal.Invoker.invokeMethod(Invoker.java:669) at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:877) at org.testng.internal.TestMethodWithDataProviderMethodWorker.call(TestMethodWithDataProviderMethodWorker.java:71) at org.testng.internal.TestMethodWithDataProviderMethodWorker.call(TestMethodWithDataProviderMethodWorker.java:14) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)

@mpkorstanje
Copy link
Contributor

Cheers. Not sure how that one slipped through.

@mpkorstanje
Copy link
Contributor

mpkorstanje commented Oct 15, 2018

There will be a new snapshot version to use in about 30 minutes. You can see the status of the build here:

https://travis-ci.org/cucumber/cucumber-jvm/builds/441894884

You can find instructions in the docs, the latest version should be 4.0.2-SNAPSHOT.

https://docs.cucumber.io/installation/java/#snapshot-releases

Owh btw. You should use either maven or gradle to manage your dependencies. You really shouldn't be using cucumber-junit:1.2.5 in combination with cucumber-core:4.0.0. cucumber-jvm-deps also hasn't been used for a while now.

@ben-arce-hdz
Copy link
Author

Okay awesome, I am not using a Dependency manager for some requirements in the project, how long take to release that version in Maven Central? since JFrog repository clones the projects from Maven

Regards

@mpkorstanje
Copy link
Contributor

When someone gets around to it. The project is mostly run by people in their spare time. Untill then the Sonatype snapshots are your best bet.

@ben-arce-hdz
Copy link
Author

Oh I see, got it, thanks

@lock
Copy link

lock bot commented Oct 15, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 15, 2019
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