You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
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.
Activity
rhafer commentedon Jan 7, 2026
https://ci.opencloud.rocks/repos/4/pipeline/241/157 logs: opencloud-eu-reva-241-test.log
https://ci.opencloud.rocks/repos/4/pipeline/229/157 logs: opencloud-eu-reva-229-test.log
https://ci.opencloud.rocks/repos/4/pipeline/197/160 logs: opencloud-eu-reva-197-test.log
fix(watchfs): Don't cache old id if a copy is detected
fix(tests): Move wait-loop for 'inotifywait' to testhelper
fix(tests): Move wait-loop for 'inotifywait' to testhelper
fix(tests): Move wait-loop for 'inotifywait' to testhelper
fix(tests): Move wait-loop for 'inotifywait' to testhelper
fix(tests): Move wait-loop for 'inotifywait' to testhelper
fix(watchfs): Don't cache old id if a copy is detected
fix(watchfs): Don't cache old id if a copy is detected
fix(watchfs): Don't cache old id if a copy is detected
rhafer commentedon Feb 9, 2026
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:
This race condition seems to be exactly what our test is triggering. The test already fails when setting up the test environment because
inotifywaitis 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.
rhafer commentedon Feb 9, 2026
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.fix(watchfs): Don't cache old id if a copy is detected
butonic commentedon May 12, 2026
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 ...
pbleser-oc commentedon Nov 16, 2026
Some numbers on how often this happens, and when, from the reva pipelines 1490 to 1756 (2026-11-03 to 2026-11-16):
unit-testruns failed. 26 of them have a readable log that names the failed package, and in 22 of those it ispkg/storage/fs/posix/tree(once together with another package). The other 4 are unrelated packages.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):
posix/treeThe 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.