libfuse / pyfuse3

Python 3 bindings for libfuse 3 with asynchronous API (Trio compatible)
https://pyfuse3.readthedocs.io/
Other
166 stars 48 forks source link

test_passthroughfs sometimes fails due to timestamp difference #57

Open ThomasWaldmann opened 2 years ago

ThomasWaldmann commented 2 years ago

Seen on github actions CI:

Traceback (most recent call last):
  File "/home/runner/work/pyfuse3/pyfuse3/test/test_examples.py", line 124, in test_passthroughfs
    tst_passthrough(src_dir, mnt_dir)
  File "/home/runner/work/pyfuse3/pyfuse3/test/test_examples.py", line 412, in tst_passthrough
    assert_same_stats(src_name, mnt_name)
  File "/home/runner/work/pyfuse3/pyfuse3/test/test_examples.py", line 438, in assert_same_stats
    assert  v1 == v2, 'Attribute {} differs by {} ({} vs {})'.format(
AssertionError: Attribute st_mtime_ns differs by 4000074 (1654852943987067641 vs 1654852943983067567)
assert 1654852943987067641 == 1654852943983067567
ThomasWaldmann commented 2 years ago

Still happens 2023-07, just have seen this with github CI.

ThomasWaldmann commented 1 year ago
______________________________ test_passthroughfs ______________________________
Traceback (most recent call last):
   File "/home/runner/work/pyfuse3/pyfuse3/test/test_examples.py", line 124, in test_passthroughfs
    tst_passthrough(src_dir, mnt_dir)
  File "/home/runner/work/pyfuse3/pyfuse3/test/test_examples.py", line 414, in tst_passthrough
    assert_same_stats(src_name, mnt_name)
  File "/home/runner/work/pyfuse3/pyfuse3/test/test_examples.py", line 440, in assert_same_stats
    assert  v1 == v2, 'Attribute {} differs by {} ({} vs {})'.format(
AssertionError: Attribute st_mtime_ns differs by 3999985 (1691339543559117222 vs 1691339543555117237)
assert 1691339543559117222 == 1691339543555117237
ThomasWaldmann commented 4 months ago

@Nikratio I am wondering: is this just a cosmetic issue due to timestamp granularity of different filesystems? 4ms seems a bit much for that. Or is it a bug? What do you think?

Nikratio commented 4 months ago

I'm not sure what's going on here. FUSE uses ns-granularity to report the timestamp from the underlying filesystem, so there should be no loss of accuracy.

Nikratio commented 4 months ago

To debug this, I'd add a sleep prior to the comparison and see if that makes the difference go up.