tests: test_timestamps_win32: compare the extracted atime with the archived one - #10392
Merged
ThomasWaldmann merged 1 commit intoSep 19, 2026
Conversation
…chived one The test compared the atime of the extracted file with the atime of the input file after "borg create". If NTFS last access time updates are enabled (fsutil behavior query disablelastaccess: DisableLastAccess = 0), reading the input file for the backup updates its atime, while borg archives (and extract restores) the atime the file had before borg opened it (see borgbackup#6194). So the test failed on such machines although borg worked correctly. GitHub's windows runners have last access time updates disabled, thus it passed there. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #10392 +/- ##
==========================================
- Coverage 88.19% 88.13% -0.07%
==========================================
Files 103 103
Lines 18822 18822
Branches 2919 2919
==========================================
- Hits 16600 16588 -12
- Misses 1548 1558 +10
- Partials 674 676 +2 ☔ View full report in Codecov by Harness. |
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.
Problem
test_timestamps_win32fails (all 3 variants) on a Windows 11 machine that has NTFS last access time updates enabled (fsutil behavior query disablelastaccess→DisableLastAccess = 0):The left value is the atime of the extracted file (correct), the right one is the atime of the input file, stat'ed after
borg create.The test assumed that borg archives the atime the input file has after the backup read it. But since #6194, borg archives the atime the file had before borg opened it. With last access time updates enabled, reading the input file bumps its atime to "now", so the comparison fails although borg works correctly. GitHub's windows runners have last access time updates disabled, so the test passes there.
Measurements on that machine
platform.set_times()by path / by fd (same sequence asextract_item)input/fileafterborg create --atimeoutput/input/fileafterborg extract(and 5 s later)borg list)So
set_timesinplatform/windows.pyxandborg extractare fine, only the test was wrong.Fix
Compare the extracted atime with the
atime_nsthe test has set (same as the mtime and birthtime assertions do, and same astest_atimedoes). This holds no matter whether last access time updates are enabled or not.Verified on the Windows 11 box (MSYS2 UCRT64, Python 3.14): before 3 failed, after 3 passed (archiver, remote_archiver, binary_archiver).
🤖 Generated with Claude Code