test: make remove-source incremental-skip test deterministic
CI / lint (pull_request) Successful in 32s
CI / sanitizers (address) (pull_request) Successful in 42s
CI / sanitizers (undefined) (pull_request) Successful in 40s
CI / fuzz-build (pull_request) Successful in 17s
CI / coverage (pull_request) Successful in 35s
CI / valgrind (pull_request) Successful in 36s
CI / build-and-test (pull_request) Successful in 3m29s

The seed run did not preserve timestamps, so the destination copy's mtime was
the write time; the incremental --remove-source-files rerun only skipped the
file when both writes happened to land in the same whole second, making the
test flaky (observed intermittently in local full-suite runs and on CI).  Seed
with -M so the destination stores the source's exact mtime.
This commit is contained in:
2026-09-06 19:53:22 +02:00
parent d6d502fbb4
commit 329fc60b14
+4 -1
View File
@@ -147,7 +147,10 @@ class TestRemoveSourceFiles:
with open(source_file, "wb") as f: with open(source_file, "wb") as f:
f.write(b"keep after skip") f.write(b"keep after skip")
result, _ = run_client(source, dest, port=shared_server.port) # The seed run preserves timestamps (-M) so the destination copy has the
# source's exact mtime; otherwise the incremental skip would depend on
# both writes landing in the same whole second (a race).
result, _ = run_client(source, dest, flags=["-M"], port=shared_server.port)
assert result.returncode == 0 assert result.returncode == 0
result, _ = run_client(source, dest, result, _ = run_client(source, dest,
flags=["--remove-source-files", "--incremental"], flags=["--remove-source-files", "--incremental"],