Selaa lähdekoodia

tests: work around strange mtime granularity issue on netbsd, fixes #204

not sure where the problem is:
it seems to announce it supports st_mtime_ns, but if one uses it and
has a file with ...123ns, i t gets restored as ...000ns.

Then I tried setting st_mtime_ns_round to -3, but it still failed with +1000ns difference.

Maybe rounding is incorrect and it should be truncating?
Issue with granularity could be in python, in netbsd (netbsd platform code), in ffs filesystem, ...
Thomas Waldmann 9 vuotta sitten
vanhempi
sitoutus
375717c095
1 muutettua tiedostoa jossa 2 lisäystä ja 0 poistoa
  1. 2 0
      borg/testsuite/__init__.py

+ 2 - 0
borg/testsuite/__init__.py

@@ -28,6 +28,8 @@ elif 'HAVE_UTIMES' in sysconfig.get_config_vars():
 else:
 else:
     st_mtime_ns_round = -9
     st_mtime_ns_round = -9
 
 
+if sys.platform.startswith('netbsd'):
+    st_mtime_ns_round = -4  # only >1 microsecond resolution here?
 
 
 has_mtime_ns = sys.version >= '3.3'
 has_mtime_ns = sys.version >= '3.3'
 utime_supports_fd = os.utime in getattr(os, 'supports_fd', {})
 utime_supports_fd = os.utime in getattr(os, 'supports_fd', {})