diff --git a/testsuite/exclude_test.py b/testsuite/exclude_test.py index a35901c2f..f3469d247 100644 --- a/testsuite/exclude_test.py +++ b/testsuite/exclude_test.py @@ -137,8 +137,15 @@ up2.mkdir() (up1 / 'dst-newness').touch() (up2 / 'src-newness').touch() -(up1 / 'same-newness').touch() -(up2 / 'same-newness').touch() +same_src = up1 / 'same-newness' +same_dst = up2 / 'same-newness' +same_src.touch() +same_dst.touch() +# Give both files the same mtime; otherwise two touch calls could straddle a +# second boundary and --update would see the destination as newer. +src_stat = same_src.stat() +dst_stat = same_dst.stat() +os.utime(same_dst, ns=(dst_stat.st_atime_ns, src_stat.st_mtime_ns)) (up1 / 'extra-src').touch() (up2 / 'extra-dest').touch()