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;


Is it just my thinking, or is that a bug in JBehave?




-- 
Mit freundlichen Grüßen / Best regards

Andreas Ebbert-Karroum | Agile Principal Consultant

codecentric AG | Merscheider Straße 1 | 42699 Solingen | Deutschland
tel: +49 (0) 212.23362825 | fax: +49 (0) 212.23362879 | mobil: +49 (0)
175.2664109
www.codecentric.de | blog.codecentric.de | www.meettheexperts.de |
www.more4fi.de

Sitz der Gesellschaft: Düsseldorf | HRB 63043
Vorstand: Klaus Jäger (Vorsitzender) . Michael Hochgürtel . Mirko Novakovic
. Rainer Vehns
Aufsichtsrat: Patric Fedlmeier (Vorsitzender) . Bernd Klinkmann . Jürgen
Schütz

Diese E-Mail einschließlich evtl. beigefügter Dateien enthält vertrauliche
und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige
Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie
bitte sofort den Absender und löschen Sie diese E-Mail und evtl.
beigefügter Dateien umgehend. Das unerlaubte Kopieren, Nutzen oder Öffnen
evtl. beigefügter Dateien sowie die unbefugte Weitergabe dieser E-Mail ist
nicht gestattet.

Reply via email to