Skip to content

Timeout custom message needs to also indicate that it was a timeout event #2288

Closed

Description

@dimanhsb

Hello,

In a user keyword, if a [Timeout] is added with a custom message, then the error produced in case of failure does not include the fact that it is a timeout (as is down in the case of other keywords, such as "Should Contain".

So something like:

*** Keywords ***
My KW
    [Timeout]  5 sec    error
    sleep  10s

would produce just "error" as failure reason and not something like "error - timeout in keyword 'My KW'", which would be very easier to debug.

So I propose to either append the fact that it is a timeout, or even remove the custom message feature altogether, if not many people are using it.

Activity

  1. pekkaklarck commented on Jan 8, 2016

    @pekkaklarck
    Member

    It is true that the resulting error message isn't too clear in this case. Obviously the user could have specified a better error message, but the end result is that debugging is problematic for others. This is problem was originally encountered in this kind of situation where there was extra spaces before min:

    *** Keywords ***
    My KW
        [Timeout]  2    min
        sleep  10s

    In the above example the timeout was supposed to be 2 minutes, but in fact it was just 2 that is interpreted by Robot to be 2 seconds. To make the situation worse, the resulting error message was very confusingly just min.

  2. pekkaklarck commented on Jan 8, 2016

    @pekkaklarck
    Member

    The above examples make it clear that something must be done. We have two options:

    1. Add the real timeout to the custom message as proposed in the original description.
    2. Remove the support for specifying a custom timeout message altogether. I'm personally in favor of this solution because I don't see any good use cases for specifying a custom message and because it would simplify Robot's internal timeout implementation a bit. This would be backwards incompatible and thus should be deprecated first. Should also ask from users do they actually have valid uses cases for the message first. I supported Remove possibility to specify custom timeout message #2291 about this possibility.
  3. changed the title [-]User keyword timeout custom message needs to also indicate that it was a timeout event[/-] [+]Timeout custom message needs to also indicate that it was a timeout event[/+] on Jan 8, 2016
  4. pekkaklarck commented on Jan 8, 2016

    @pekkaklarck
    Member

    I will target this issue for RF 3.0.1, but hope we can instead remove custom timeout messages altogether (#2291). In that case this issue will be closed and we need a new one about deprecating custom messages.

  5. added this to the 3.0.1 milestone on Jan 8, 2016
  6. pekkaklarck commented on Feb 24, 2016

    @pekkaklarck
    Member

    Nobody has objected removing custom timeout messages altogether. It seems it is better to deprecate them in RF 3.0.1 instead of enhancing them. See #2291 for details.

  7. pekkaklarck commented on Jun 1, 2016

    @pekkaklarck
    Member

    I submitted separate issue #2387 about deprecating custom timeout messages in RF 3.0.1. This issue can be closed.

  8. removed this from the 3.0.1 milestone on Jun 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions