|
6 | 6 |
|
7 | 7 | from ...constants import * # NOQA |
8 | 8 | from .. import are_symlinks_supported, are_hardlinks_supported |
9 | | -from ..platform import is_win32 |
| 9 | +from ..platform import is_win32, is_darwin |
10 | 10 | from . import ArchiverTestCaseBase, RemoteArchiverTestCaseBase, ArchiverTestCaseBinaryBase, RK_ENCRYPTION, BORG_EXES |
11 | 11 |
|
12 | 12 |
|
@@ -247,12 +247,16 @@ def test_time_diffs(self): |
247 | 247 | if is_win32: |
248 | 248 | # Sleeping for 15s because Windows doesn't refresh ctime if file is deleted and recreated within 15 seconds. |
249 | 249 | time.sleep(15) |
| 250 | + elif is_darwin: |
| 251 | + time.sleep(1) # HFS has a 1s timestamp granularity |
250 | 252 | self.create_regular_file("test_file", size=15) |
251 | 253 | self.cmd(f"--repo={self.repository_location}", "create", "archive2", "input") |
252 | 254 | output = self.cmd(f"--repo={self.repository_location}", "diff", "archive1", "archive2") |
253 | 255 | self.assert_in("mtime", output) |
254 | 256 | self.assert_in("ctime", output) # Should show up on windows as well since it is a new file. |
255 | | - os.chmod("input/test_file", 777) |
| 257 | + if is_darwin: |
| 258 | + time.sleep(1) # HFS has a 1s timestamp granularity |
| 259 | + os.chmod("input/test_file", 0o777) |
256 | 260 | self.cmd(f"--repo={self.repository_location}", "create", "archive3", "input") |
257 | 261 | output = self.cmd(f"--repo={self.repository_location}", "diff", "archive2", "archive3") |
258 | 262 | self.assert_not_in("mtime", output) |
|
0 commit comments