Skip to content

CI: hardlink result unexpected in pysdk test. #5982

Open
@zhoucheng361

Description

@zhoucheng361

What happened:

https://github.com/juicedata/juicefs/actions/runs/14453598157/job/40531726551

Traceback (most recent call last):
  File "/home/runner/work/juicefs/juicefs/.github/scripts/hypo/fs.py", line 712, in <module>
    juicefs_machine.runTest()
  File "/usr/local/lib/python3.10/dist-packages/hypothesis/stateful.py", line 460, in runTest
    run_state_machine_as_test(cls, settings=self.settings)
  File "/usr/local/lib/python3.10/dist-packages/hypothesis/stateful.py", line 261, in run_state_machine_as_test
    state_machine_test(state_machine_factory)
  File "/usr/local/lib/python3.10/dist-packages/hypothesis/stateful.py", line 115, in run_state_machine
    @given(st.data())
  File "/usr/local/lib/python3.10/dist-packages/hypothesis/core.py", line 1839, in wrapped_test
    raise the_error_hypothesis_found
  File "/usr/local/lib/python3.10/dist-packages/hypothesis/core.py", line 1807, in wrapped_test
    state.run_engine()
  File "/usr/local/lib/python3.10/dist-packages/hypothesis/core.py", line 1435, in run_engine
    _raise_to_user(
  File "/usr/local/lib/python3.10/dist-packages/hypothesis/core.py", line 1474, in _raise_to_user
    raise the_error_hypothesis_found
  File "/usr/local/lib/python3.10/dist-packages/hypothesis/core.py", line 1351, in run_engine
    self.execute_once(
  File "/usr/local/lib/python3.10/dist-packages/hypothesis/core.py", line 1024, in execute_once
    result = self.test_runner(data, run)
  File "/usr/local/lib/python3.10/dist-packages/hypothesis/core.py", line 729, in default_executor
    return function(data)
  File "/usr/local/lib/python3.10/dist-packages/hypothesis/core.py", line 996, in run
    return test(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/hypothesis/stateful.py", line 115, in run_state_machine
    @given(st.data())
  File "/usr/local/lib/python3.10/dist-packages/hypothesis/core.py", line 894, in test
    return self.test(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/hypothesis/stateful.py", line 204, in run_state_machine
    result = rule.function(machine, **data)
  File "/home/runner/work/juicefs/juicefs/.github/scripts/hypo/fs.py", line 442, in hardlink
    src_file = Files.filter(lambda x: x != multiple()),
  File "/usr/local/lib/python3.10/dist-packages/hypothesis/stateful.py", line 892, in precondition_wrapper
    return f(*args, **kwargs)
  File "/home/runner/work/juicefs/juicefs/.github/scripts/hypo/fs.py", line 451, in hardlink
    assert self.equal(result1, result2), red(f'hardlink:\nresult1 is {result1}\nresult2 is {result2}')
AssertionError: hardlink:
result1 is NotADirectoryError:[Errno 20] Not a directory: '/tmp/fsrand/r/a' -> '/tmp/fsrand/a/a'
result2 is OSError:call jfs_link failed: [Errno 2] No such file or directory: ["b'/fsrand/r/a'", "b'/fsrand/a/a'"]
Falsifying example:
state = JuicefsMachine()
folders_0 = state.init_folders()
files_0 = state.create_file(content=b'gs', file_name='u', parent=folders_0, umask=18, user='root')
files_1 = state.create_file(content=b'', file_name='lltd', parent=folders_0, umask=18, user='root')
files_2 = state.create_file(content=b'', file_name='as', parent=folders_0, umask=18, user='root')
state.read(encoding='utf-8', errors='strict', file=files_2, length=0, mode='x', offset=0, user='root', whence=0)
files_3 = state.create_file(content=b'', file_name='o', parent=folders_0, umask=18, user='root')
files_4 = state.hardlink(link_file_name='ios', parent=folders_0, src_file=files_3, umask=18, user='root')
files_5 = state.hardlink(link_file_name='zbny', parent=folders_0, src_file=files_4, umask=18, user='root')
state.read(encoding='utf-8', errors='strict', file=files_5, length=0, mode='x', offset=0, user='root', whence=0)
files_6 = state.hardlink(link_file_name='if', parent=folders_0, src_file=files_5, umask=18, user='root')
folders_1 = state.mkdir(mode=0, parent=folders_0, subdir='r', umask=18, user='root')
files_7 = state.create_file(content=b'', file_name='espa', parent=folders_1, umask=18, user='root')
folders_2 = state.rename_dir(entry=folders_0, new_entry_name='a', parent=folders_1, umask=18, user='root')
files_8 = state.create_file(content=b'', file_name='jwef', parent=folders_0, umask=18, user='root')
files_9 = state.create_file(content=b'', file_name='a', parent=folders_1, umask=18, user='root')
state.read(encoding='utf-8', errors='strict', file=files_0, length=0, mode='x', offset=0, user='root', whence=0)
state.read(encoding='utf-8', errors='strict', file=files_0, length=0, mode='x', offset=0, user='root', whence=0)
folders_3 = state.rename_dir(entry=folders_1, new_entry_name='a', parent=folders_2, umask=18, user='root')
state.create_file(content=b'', file_name=folders_3, parent=folders_3, umask=18, user='root')
state.read(encoding='utf-8', errors='strict', file=files_9, length=0, mode='x', offset=0, user='root', whence=0)
state.read(encoding='utf-8', errors='strict', file=files_9, length=0, mode='x', offset=0, user='root', whence=0)
state.read(encoding='utf-8', errors='strict', file=files_9, length=0, mode='x', offset=0, user='root', whence=0)
state.read(encoding='utf-8', errors='strict', file=files_9, length=0, mode='x', offset=0, user='root', whence=0)
state.read(encoding='utf-8', errors='strict', file=files_9, length=0, mode='x', offset=0, user='root', whence=0)
state.create_file(content=b'', file_name=folders_3, parent=folders_3, umask=18, user='root')
files_10 = state.create_file(content=b'', file_name=folders_1, parent=folders_0, umask=18, user='root')
state.create_file(content=b'', file_name=folders_3, parent=folders_3, umask=18, user='root')
state.hardlink(link_file_name=folders_3, parent=folders_3, src_file=folders_1, umask=18, user='root')
state.hardlink(link_file_name=folders_3, parent=folders_3, src_file=files_9, umask=18, user='root')
state.teardown()

What you expected to happen:

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?

Environment:

  • JuiceFS version (use juicefs --version) or Hadoop Java SDK version:
  • Cloud provider or hardware configuration running JuiceFS:
  • OS (e.g cat /etc/os-release):
  • Kernel (e.g. uname -a):
  • Object storage (cloud provider and region, or self maintained):
  • Metadata engine info (version, cloud provider managed or self maintained):
  • Network connectivity (JuiceFS to metadata engine, JuiceFS to object storage):
  • Others:

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/ciIssues or PRs related to CI

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions