Skip to content

Wait Until Removed/Created wait forever when timeout is zero (regression in 7.4) #5863

Description

@Vineet829

Since RF 7.4, Wait Until Removed and Wait Until Created never time out when the timeout is zero. They wait until the file appears or disappears, or until a test timeout stops them.

*** Settings ***
Library    OperatingSystem

*** Test Cases ***
Zero remove timeout
    [Timeout]    2 s
    Create File    ${TEMPDIR}/rf-zero-existing.txt
    Wait Until Removed    ${TEMPDIR}/rf-zero-existing.txt    0

Zero create timeout
    [Timeout]    2 s
    Wait Until Created    ${TEMPDIR}/rf-zero-missing.txt    0s

On master (7.5.2.dev1) both tests fail with Test timeout 2 seconds exceeded. With RF 7.3.2 they fail at once with '…/rf-zero-existing.txt' was not removed in 0 seconds. and '…/rf-zero-missing.txt' was not created in 0 seconds.

Both keywords convert the timeout with timeout.total_seconds() if timeout else -1. timedelta(0) is falsy, so a zero timeout becomes -1, which means no limit. The keyword documentation names only "a negative value or None" as no limit.

Changing the check to timeout is not None restores the 7.3 behaviour. I have that change with two acceptance tests and can open a pull request if zero should fail fast again rather than mean no limit.

Activity

  1. pekkaklarck commented on Nov 19, 2026

    @pekkaklarck
    Member

    This was broken when adding support for using None for disabling the timeout (#5534). The change was done in commit eb7d773 that also added typing to OperatingSystem (#5373).

    This is clearly a regression and I also consider the old semantics better in general. The only problem is that changing the behavior again is a backwards incompatible change as well, especially when there's already been 7.4 and 7.5 releases. I believe we should still change it, but let's not do it in RF 7.5.x series to avoid behavioral changes in bug fix releases. Please create a PR!

  2. added this to the v7.6 milestone on Nov 19, 2026
  3. added theissue type on Nov 19, 2026
  4. pekkaklarck commented on Nov 20, 2026

    @pekkaklarck
    Member

    Thanks for PR #5864 @Vineet829! I'll merge it after we've started RF 7.6 development.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions