Issue Type: Bug Bug
Affects Versions: 3.8
Assignee: Unassigned
Components: Core
Created: 17/Jul/13 6:18 AM
Description:

Hi,

as I read the specification of a timeout, it is setting the controls to let a story time out, when a specified amount of time has passed. By the name this is a setting per story. So, when I have a timeout of 300s per story, I should be able to have 100 stories, which take 250 seconds each.

The way it is implemented is different, though. The StoryManager measures the start time right after it kicked off all stories, and is waiting for all of them to be completed.

https://github.com/jbehave/jbehave-core/blob/master/jbehave-core/src/main/java/org/jbehave/core/embedder/StoryManager.java

    public void waitUntilAllDoneOrFailed(BatchFailures failures) {
        long start = System.currentTimeMillis();
        boolean allDone = false;
        while (!allDone) {
            allDone = true;
            for (RunningStory runningStory : runningStories.values()) {
                Future<ThrowableStory> future = runningStory.getFuture();
                if (!future.isDone()) {
                    allDone = false;
                    long durationInSecs = storyDurationInSecs(start);
                    long timeoutInSecs = embedderControls.storyTimeoutInSecs();
                    if (durationInSecs > timeoutInSecs) {
                        Story story = runningStory.getStory();
                        StoryDuration storyDuration = new StoryDuration(durationInSecs, timeoutInSecs);
                        embedderMonitor.storyTimeout(story, storyDuration);
                        storyRunner.cancelStory(story, storyDuration);
                        future.cancel(true);
                    }
                    break;
                }
Project: JBehave
Priority: Major Major
Reporter: Andreas Ebbert-Karroum
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email

Reply via email to