Merged
Conversation
This was referenced Mar 6, 2025
The test was added in dc34990, it turns out that it's flaky. It failed once on the Debian build infra, cf. [1]. The problem is that the command `rsync -aH '$fromdir/sym' '$todir'` updates the mod time of `$todir`, so there might be a diff between the output of `rsync_ls_lR $fromdir` and `rsync_ls_lR $todir`, if ever rsync runs 1 second (or more) after the directories were created. To clarify: it's easy to make the test fails 100% of the times with this change: ``` makepath "$fromdir/sym" "$todir" +sleep 5 checkit "$RSYNC -aH '$fromdir/sym' '$todir'" "$fromdir" "$todir" ``` With the fix proposed here, we don't use `checkit` anymore, instead we just run the rsync command, then a simple `diff` to compare the two directories. This is exactly what the other `-H` test just above does. In case there's some doubts, `diff` fails if `sym` is missing: ``` $ mkdir -p foo/sym bar $ diff foo bar || echo KO! Only in foo: sym KO! ``` I tested that, after this commit, the test still catches the `-H` regression in rsync 3.4.0. Fixes: RsyncProject#735 [1]: https://buildd.debian.org/status/fetch.php?pkg=rsync&arch=ppc64el&ver=3.4.1%2Bds1-1&stamp=1741147156&raw=0
9f31dde to
90b745e
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a flaky test in the hardlinks test suite that was causing intermittent failures on the Debian build infrastructure. The test was failing due to timing issues where rsync could update the modification time of the target directory, causing differences between source and destination when compared using rsync_ls_lR.
Key changes:
- Replace
checkitfunction call with directrsynccommand execution - Add explicit
diffcomparison between source and destination directories - Align the test approach with other hardlink tests in the same file
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
tridge
approved these changes
Aug 23, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The test was added in dc34990, it turns out that it's flaky. It failed once on the Debian build infra, cf. 1.
The problem is that the command
rsync -aH '$fromdir/sym' '$todir'updates the mod time of$todir, so there might be a diff between the output ofrsync_ls_lR $fromdirandrsync_ls_lR $todir, if ever rsync runs 1 second (or more) after the directories were created.To clarify: it's easy to make the test fails 100% of the times with this change:
With the fix proposed here, we don't use
checkitanymore, instead we just run the rsync command, then a simplediffto compare the two directories. This is exactly what the other-Htest just above does.In case there's some doubts,
difffails ifsymis missing:I tested that, after this commit, the test still catches the
-Hregression in rsync 3.4.0.Fixes: #735