From af7e8a5080de4138373fb1b83ef1da455bd364b2 Mon Sep 17 00:00:00 2001 From: Angel J <78835633+iamanaws@users.noreply.github.com> Date: Wed, 7 Oct 2026 14:50:26 -0700 Subject: [PATCH 1/2] testsuite: fix timestamp race in exclude test The same-newness files must have equal modification times, but separate touch calls can straddle a second boundary and make the destination newer. This causes --update to skip it unexpectedly. Copy the source timestamps to the destination explicitly. --- testsuite/exclude_test.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/testsuite/exclude_test.py b/testsuite/exclude_test.py index a35901c2f..2b04945d4 100644 --- a/testsuite/exclude_test.py +++ b/testsuite/exclude_test.py @@ -139,6 +139,9 @@ (up2 / 'src-newness').touch() (up1 / 'same-newness').touch() (up2 / 'same-newness').touch() +# Give both files the same mtime; otherwise two touch calls could straddle a +# second boundary and --update would see the destination as newer. +shutil.copystat(up1 / 'same-newness', up2 / 'same-newness') (up1 / 'extra-src').touch() (up2 / 'extra-dest').touch() From 0a47b35b9dfc071c836fb533d8a38adcd12660c8 Mon Sep 17 00:00:00 2001 From: Zen Dodd Date: Thu, 8 Oct 2026 14:14:45 +1000 Subject: [PATCH 2/2] testsuite: only copy update-test mtime --- testsuite/exclude_test.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/testsuite/exclude_test.py b/testsuite/exclude_test.py index 2b04945d4..f3469d247 100644 --- a/testsuite/exclude_test.py +++ b/testsuite/exclude_test.py @@ -137,11 +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. -shutil.copystat(up1 / 'same-newness', up2 / 'same-newness') +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()