Can't run multiple stories with Maven plugin

Description

I'm using the 4.0.1 Maven plugin to run stories, and am noticing that I can't run more than one story without the build failing with a RejectedExecutionException.

When debugging in Eclipse with mvnDebug and attaching to the local debug port, I can attach a breakpoint in the shutdownNow() method for the executor service used by the StoryManager class. This method is called by the shutdownExecutorService method in Embedder, which in turn gets called when one of my story classes which extends JUnitStory completes.

However, the StoryManager does not get recreated at this point, meaning I'm left with a terminated thread pool - so when the next story comes up, it gets rejected since no threads are running or can be created in that pool.

Downgrading to 3.9.5 fixes this issue for me.

I would consider this a blocking issue, as most people using JUnitStory likely have more than one of them, and this will cause builds to fail for no reason of the application developers.

Activity

Show:

Mauro Talevi May 23, 2018 at 2:51 PM

Pulled with thanks.

Valery Yatsynovich May 22, 2018 at 9:09 PM

Hi ,

Could you please review the pull request: https://github.com/jbehave/jbehave-core/pull/190/files ?

Thanks

Pascal Wittmann January 6, 2016 at 2:22 PM

Pascal Wittmann December 21, 2015 at 3:24 PM
Edited

I stumbled upon this problem as well and tried to come up with a fix. However, I am not sure who to fix this properly. The problem is, that the method `runStoriesAsPaths` calls shutdown() on the executor service. If `runStoriesAsPaths` is called again with the `Embedder` instance, a new executor service is added to the embedder, but the story manager still points to the old executor service and we cannot change that reference because that field is final. So we would need a executor service that is shutdown only if the Embedder isn't used anymore. We could do that using finalize(), but that does not sound like a good solution to me.

However I am not sure about the actual use case of JBEHAVE-1084. I don't see a way to manipulate the story manager (besides ´clear()`). If there is no real use case I would vote for reverting that commit as it breaks the abstraction and makes it hard to shutdown the executor properly.

CC @maurotalevi @tridexnet

Juha Siponen July 22, 2015 at 10:18 AM

I'm having the same issue in my project. Running stories with Maven works as expected in 4.0 but not in 4.0.1. After testing with different revision of jbehave-core, it seems that this is caused by JBEHAVE-1084.

Fixed

Details

Assignee

Reporter

Fix versions

Priority

Created July 6, 2015 at 7:40 PM
Updated May 23, 2018 at 2:51 PM
Resolved May 23, 2018 at 2:51 PM