You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@karaf.apache.org by "Martin Krüger (JIRA)" <ji...@apache.org> on 2018/12/13 13:43:00 UTC

[jira] [Comment Edited] (KARAF-6048) Camel Test case prone to endless loop

    [ https://issues.apache.org/jira/browse/KARAF-6048?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16720180#comment-16720180 ] 

Martin Krüger edited comment on KARAF-6048 at 12/13/18 1:42 PM:
----------------------------------------------------------------

The patch just shortens the wile loop. The issue is not fixed. The endless loop is still present.

A better way would be 
{code}
        String output = "";
        for (int loopCounter = 0; loopCounter < 20; loopCounter++) {
            output = executeCommand("camel:route-list");
            if (output.contains("Started")) {
                break;
            }
            Thread.sleep(500);
        }
        if (!output.contains("Started")) {
            fail();
        }
 {code}


was (Author: martin.krueger):
The patch just shortens the wile loop. The issue is not fixed. The endless loop is still present.

A better way would be 
{code}
        String output = "";
        for (int loopCounter = 0; loopCounter < 20; loopCounter++) {
            output = executeCommand("camel:route-list");
            if (output.contains("Started")) {
                break;
            }
            Thread.sleep(500);
        }
         if (!output.contains("Started")) {
            fail();
         }
 {code}

> Camel Test case prone to endless loop
> -------------------------------------
>
>                 Key: KARAF-6048
>                 URL: https://issues.apache.org/jira/browse/KARAF-6048
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf
>            Reporter: Martin Krüger
>            Assignee: Jean-Baptiste Onofré
>            Priority: Major
>             Fix For: 4.2.2
>
>
> During my build the test case CamelExampleTest.testBlueprintDSL() ended up in an endless loop.
> The problem is {code}
>         while (true) {
>             if (!output.contains("Started")) {
>                 Thread.sleep(500);
>                 output = executeCommand("camel:route-list");
>             } else {
>                 break;
>             }
>         }{code} in the verify method. This loop has to contain an exit path with a failure.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)