Skip to content

Prevent absorbing keyword timeout#46

Merged
JFoederer merged 2 commits into
mainfrom
prevent-absorbing-keyword-timeout
Feb 6, 2026
Merged

Prevent absorbing keyword timeout#46
JFoederer merged 2 commits into
mainfrom
prevent-absorbing-keyword-timeout

Conversation

@JFoederer
Copy link
Copy Markdown
Owner

@JFoederer JFoederer commented Feb 4, 2026

Keyword timeouts in Robot are triggered by raising a TimeoutExceeded exception. In Robot's exception classes tree this exception is derived from the regular Exception type, unlike similar exception types that interrupt user code, like KeyboardInterrupt that are derived from BaseException. As a result, some broader exception traps could absorb a timeout exception, failing the keyword to be interrupted and getting stuck. This PR removes too generic catch-all clauses where possible and reraises TimeoutExceeded in situations where unknown exceptions can arise from code outside RobotMBT's control.

@JFoederer
Copy link
Copy Markdown
Owner Author

I did not add a test case for this fix, due to the issue where Robot does not allow you to catch timeouts. the following code snippet does not work, it still fails on the timeout:

*** Test Cases ***
Keyword timeout propagates back to Robot
    Run keyword and expect error    Keyword timeout*    Time-bound keyword

*** Keywords ***
Time-bound keyword
    [Timeout]    200 milliseconds
    Sleep    2 sec

See also this thread on Slack

@JFoederer
Copy link
Copy Markdown
Owner Author

Issue #5610 and pull request #5611 are available for Robot Framework to fix this from RF Core.

@JFoederer JFoederer merged commit 3117997 into main Feb 6, 2026
3 checks passed
@JFoederer JFoederer deleted the prevent-absorbing-keyword-timeout branch February 6, 2026 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant