Coder Social home page Coder Social logo

Comments (4)

skurlow avatar skurlow commented on June 12, 2024

I haven't downloaded your project but I wonder does it help you if you do not hide the passed tests??? You have the Hide Passed tests option turned on in the top left hand corner of your screen shot.

Also can you provide the full text in the console? It seems like the runner is running your same my.story at least 3 times.

from jbehave-junit-runner.

nasalp avatar nasalp commented on June 12, 2024

Toggling the Hide Passed certainly helped, so we can assume the issue is resolved.
But still the console output doesn't seem "right", as if all scenarios were executed concurrently
:
Processing system properties {}
Using controls EmbedderControls[batch=false,skip=false,generateViewAfterStories=true,ignoreFailureInStories=true,ignoreFailureInView=true,verboseFailures=false,verboseFiltering=false,storyTimeoutInSecs=60,threads=2]

(BeforeStories)

Running story stories/my.story

(stories/my.story)
Scenario: 2 squared
Given a variable x with value 2
Given a variable x with value 2
Given a variable x with value 2
When I multiply x by 2
When I multiply x by 2
When I multiply x by 2
Then x should equal 4
Then x should equal 4
Then x should equal 4

Scenario: 3 squared
Scenario: 3 squared
Scenario: 3 squared
Given a variable x with value 3
Given a variable x with value 3
Given a variable x with value 3
When I multiply x by 3
When I multiply x by 3
When I multiply x by 3
Then x should equal 10 (FAILED)
Then x should equal 10 (FAILED)
Then x should equal 10 (FAILED)
(java.lang.RuntimeException: x is 9, but should be 10)
(java.lang.RuntimeException: x is 9, but should be 10)
(java.lang.RuntimeException: x is 9, but should be 10)

java.lang.RuntimeException: x is 9, but should be 10
at behave_test1.steps.MySteps.thenXshouldBe(MySteps.java:21)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at org.jbehave.core.steps.StepCreator$ParameterisedStep.perform(StepCreator.java:550)
at org.jbehave.core.embedder.StoryRunner$FineSoFar.run(StoryRunner.java:531)
at org.jbehave.core.embedder.StoryRunner.runStepsWhileKeepingState(StoryRunner.java:511)
at org.jbehave.core.embedder.StoryRunner.runScenarioSteps(StoryRunner.java:475)
at org.jbehave.core.embedder.StoryRunner.runCancellable(StoryRunner.java:308)
at org.jbehave.core.embedder.StoryRunner.run(StoryRunner.java:220)
at org.jbehave.core.embedder.StoryRunner.run(StoryRunner.java:181)
at org.jbehave.core.embedder.StoryManager$EnqueuedStory.call(StoryManager.java:229)
at org.jbehave.core.embedder.StoryManager$EnqueuedStory.call(StoryManager.java:201)
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)

Scenario: 5 squared
Scenario: 5 squared
Scenario: 5 squared
Given a variable x with value 4
Given a variable x with value 4
Given a variable x with value 4
When I multiply x by 4
When I multiply x by 4
When I multiply x by 4
Then x should equal 10 (FAILED)
Then x should equal 10 (FAILED)
Then x should equal 10 (FAILED)
(java.lang.RuntimeException: x (java.lang.RuntimeException: x (java.lang.RuntimeException: x is 16, but should be 10)
is 16, but should be 10)
is 16, but should be 10)

java.lang.RuntimeException: x is 16, but should be 10
at behave_test1.steps.MySteps.thenXshouldBe(MySteps.java:21)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at org.jbehave.core.steps.StepCreator$ParameterisedStep.perform(StepCreator.java:550)
at org.jbehave.core.embedder.StoryRunner$FineSoFar.run(StoryRunner.java:531)
at org.jbehave.core.embedder.StoryRunner.runStepsWhileKeepingState(StoryRunner.java:511)
at org.jbehave.core.embedder.StoryRunner.runScenarioSteps(StoryRunner.java:475)
at org.jbehave.core.embedder.StoryRunner.runCancellable(StoryRunner.java:308)
at org.jbehave.core.embedder.StoryRunner.run(StoryRunner.java:220)
at org.jbehave.core.embedder.StoryRunner.run(StoryRunner.java:181)
at org.jbehave.core.embedder.StoryManager$EnqueuedStory.call(StoryManager.java:229)
at org.jbehave.core.embedder.StoryManager$EnqueuedStory.call(StoryManager.java:201)
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)

Failed to run story stories/my.story
java.lang.RuntimeException: x is 9, but should be 10
at behave_test1.steps.MySteps.thenXshouldBe(MySteps.java:21)
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.jbehave.core.steps.StepCreator$ParameterisedStep.perform(StepCreator.java:550)
at org.jbehave.core.embedder.StoryRunner$FineSoFar.run(StoryRunner.java:531)
at org.jbehave.core.embedder.StoryRunner.runStepsWhileKeepingState(StoryRunner.java:511)
at org.jbehave.core.embedder.StoryRunner.runScenarioSteps(StoryRunner.java:475)
at org.jbehave.core.embedder.StoryRunner.runCancellable(StoryRunner.java:308)
at org.jbehave.core.embedder.StoryRunner.run(StoryRunner.java:220)
at org.jbehave.core.embedder.StoryRunner.run(StoryRunner.java:181)
at org.jbehave.core.embedder.StoryManager$EnqueuedStory.call(StoryManager.java:229)
at org.jbehave.core.embedder.StoryManager$EnqueuedStory.call(StoryManager.java:201)
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)

(AfterStories)

Generating reports view to 'C:\Documents and Settings\Piotrek\IdeaProjects\jbeh1\target\jbehave' using formats '[stats, console, txt, html, xml, junitscenarioreporter]' and view properties '{defaultFormats=stats, decorateNonHtml=true, viewDirectory=view, decorated=ftl/jbehave-report-decorated.ftl, reports=ftl/jbehave-reports-with-totals.ftl, maps=ftl/jbehave-maps.ftl, navigator=ftl/jbehave-navigator.ftl, views=ftl/jbehave-views.ftl, nonDecorated=ftl/jbehave-report-non-decorated.ftl}'
Reports view generated with 2 stories (of which 0 pending) containing 6 scenarios (of which 0 pending)
Failures in reports view: 4 scenarios failed

And with tests shown:

from jbehave-junit-runner.

skurlow avatar skurlow commented on June 12, 2024

It is recommended to not run using multiple threads if you look at the Enabling section of the wiki. It is suggested to use JUnitReportingRunner.recommendedControls() which sets single threaded behaviour:

public static EmbedderControls recommendedControls(Embedder embedder) {
    return embedder.embedderControls()
    // don't throw an exception on generating reports for failing stories
            .doIgnoreFailureInView(true)
            // don't throw an exception when a story failed
            .doIgnoreFailureInStories(true)
            // .doVerboseFailures(true)
            .useThreads(1);
}

from jbehave-junit-runner.

nasalp avatar nasalp commented on June 12, 2024

Ok, but I thought specification says that a single .story is always executed by one thread, so it should't be an issue here. All displayed tests are part of the same story.

from jbehave-junit-runner.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.