Skip to content

unittest flaky: pkg/storage/fs/posix/tree/tree_test.go #482

Open

Activity

  1. moved this from Qualification to No status in OpenCloud Team Boardon Jan 7, 2026
  2. moved this to Qualification in OpenCloud Team Boardon Jan 7, 2026
  3. self-assigned this
    on Jan 12, 2026
  4. moved this from Qualification to In Progress in OpenCloud Team Boardon Jan 12, 2026
  5. rhafer commented on Feb 9, 2026

    @rhafer
    MemberAuthor

    This issue was partially fixed by #506.

    However, the unit test is still flaky. As far as I understand that flakiness is however introduced by a shortcoming in inotifywait.
    From the inotifywait man page:

    BUGS
           There are race conditions in the recursive directory watching code which can cause events to be missed
           if they occur in a directory immediately after that directory is created.  This is probably not fixable.
    

    This race condition seems to be exactly what our test is triggering. The test already fails when setting up the test environment because inotifywait is not issuing events for files created in the space created by the test setup.
    Is is very likely happening because at startup the creation of the folder hierarchy triggers the above mentioned race conditions.

  6. moved this from In Progress to Blocked in OpenCloud Team Boardon Feb 9, 2026
  7. rhafer commented on Feb 9, 2026

    @rhafer
    MemberAuthor

    While there is not much we can do to completely fix this in our code (apart from not relying on inotifywait)

    We need to at least document the shortcomings of inotifywait. I am moving this to blocked for now and unassign myself as I am not able to spent time on this issue.

  8. removed their assignment
    on Feb 9, 2026
  9. butonic commented on May 12, 2026

    @butonic
    Member

    Maybe we can mitigate this by enabling the debounce so our code scans the children after a directory has been created?

    The root cause should be fixed in inotifywait, however ... that is probably out of scrope? The behaviour is documented in the man page https://www.man7.org/linux/man-pages/man1/inotifywait.1.html#BUGS

    Another option would be https://wiki.archlinux.org/title/Audit_framework or https://www.man7.org/linux/man-pages/man7/fanotify.7.html ... or even SECCOMP ...

  10. pbleser-oc commented on Nov 16, 2026

    @pbleser-oc
    Member

    Some numbers on how often this happens, and when, from the reva pipelines 1490 to 1756 (2026-11-03 to 2026-11-16):

    • 43 of 232 unit-test runs failed. 26 of them have a readable log that names the failed package, and in 22 of those it is pkg/storage/fs/posix/tree (once together with another package). The other 4 are unrelated packages.
    • The 22 failures are spread over 15 different pull requests and branches, and the failing spec varies: one of the "Watching tree" specs, or the suite setup itself (SynchronizedBeforeSuite, when inotifywait isn't up in time).

    They depend clearly on how busy the CI agent is. For each run, I counted how many other workflows ran on the same agent at the same time (from the agent and the start and end of each workflow in Woodpecker, over all repositories):

    Other workflows on the same agent Runs Failed in posix/tree
    0 to 3 105 3 (3%)
    3 to 4 18 1 (6%)
    4 to 6 88 18 (20%)

    The runs that failed here had 5 other workflows on their agent in the median, the ones that passed 2.9. That fits the inotifywait race described above: the window between creating a directory and inotifywait watching it gets longer when the machine is busy, so the events are missed more often. The same holds for the timeouts of the benchmark, see #997 (comment), where most agents ran up to 7 workflows at once.

    So fewer parallel workflows per agent would make this much rarer, but not go away. For the tests themselves, waiting until the watch is actually set up and the debounce rescan suggested above would both help with the same window.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions