Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vagrant: netbsd9 test failure #8703

Open
ThomasWaldmann opened this issue Mar 23, 2025 · 1 comment
Open

vagrant: netbsd9 test failure #8703

ThomasWaldmann opened this issue Mar 23, 2025 · 1 comment
Labels
help wanted os: bsd FreeBSD, NetBSD, OpenBSD, ...

Comments

@ThomasWaldmann
Copy link
Member

ThomasWaldmann commented Mar 23, 2025

master branch

    netbsd9: __________________ test_basic_functionality[remote_archiver] ___________________
    netbsd9: [gw7] netbsd9 -- Python 3.12.8 /vagrant/borg/borg/.tox/py312-none/bin/python
    netbsd9:
    netbsd9: archivers = 'remote_archiver'
    netbsd9: request = <FixtureRequest for <Function test_basic_functionality[remote_archiver]>>
    netbsd9:
    netbsd9:     def test_basic_functionality(archivers, request):
...
    netbsd9:         output = cmd(archiver, "diff", "test0", "test1b", "--content-only")
    netbsd9:         do_asserts(output, False, content_only=True)
    netbsd9:
    netbsd9:         output = cmd(archiver, "diff", "test0", "test1a", "--json-lines")
    netbsd9: >       do_json_asserts(output, True)
    netbsd9:
    netbsd9: /vagrant/borg/borg/src/borg/testsuite/archiver/diff_cmd_test.py:257:
    netbsd9: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    netbsd9:
    netbsd9: output = '{"changes": [{"item1": "2025-03-23T17:09:52.372257+00:00", "item2": "2025-03-23T17:10:26.935509+00:00", "type": "ctim...ed directory"}], "path": "input/dir_removed"}\n{"changes": [{"type": "removed link"}], "path": "input/link_removed"}\n'
    netbsd9: can_compare_ids = True, content_only = False
    netbsd9:
    netbsd9:     def do_json_asserts(output, can_compare_ids, content_only=False):
    netbsd9:         def get_changes(filename, data):
    netbsd9:             chgsets = [j["changes"] for j in data if j["path"] == filename]
    netbsd9:             assert len(chgsets) < 2
    netbsd9:             # return a flattened list of changes for given filename
    netbsd9:             return sum(chgsets, [])
    netbsd9:
    netbsd9:         # convert output to list of dicts
    netbsd9:         joutput = [json.loads(line) for line in output.split("\n") if line]

 netbsd9:
    netbsd9:         # File contents changed (deleted and replaced with a new file)
    netbsd9:         expected = {"type": "modified", "added": 4096, "removed": 1024} if can_compare_ids else {"type": "modified"}
    netbsd9:         assert expected in get_changes("input/file_replaced", joutput)
    netbsd9:
    netbsd9:         # File unchanged
    netbsd9:         assert not any(get_changes("input/file_unchanged", joutput))
    netbsd9:
    netbsd9:         # Do not show a 0 byte change for a file whose contents weren't modified.
    netbsd9:         unexpected = {"type": "modified", "added": 0, "removed": 0}
    netbsd9:         assert unexpected not in get_changes("input/file_touched", joutput)
    netbsd9:         if not content_only:
    netbsd9:             # on win32, ctime is the file creation time and does not change.
    netbsd9:             expected = {"mtime"} if is_win32 else {"mtime", "ctime"}
    netbsd9: >           assert expected.issubset({c["type"] for c in get_changes("input/file_touched", joutput)})
    netbsd9: E           AssertionError: assert False
    netbsd9: E            +  where False = <built-in method issubset of set object at 0x7a19fe1603b0>({'mtime'})
    netbsd9: E            +    where <built-in method issubset of set object at 0x7a19fe1603b0> = {'ctime', 'mtime'}.issubset
    netbsd9:
    netbsd9: /vagrant/borg/borg/src/borg/testsuite/archiver/diff_cmd_test.py:178: AssertionError

@ThomasWaldmann ThomasWaldmann changed the title vagrant: netbsd9 test failures vagrant: netbsd9 test failure Mar 23, 2025
@ThomasWaldmann
Copy link
Member Author

ThomasWaldmann commented Mar 23, 2025

Seems like there is no ctime (behaves like win32).

So, is there a bug in the code that only shows on netbsd or is the test wrong for netbsd?

@ThomasWaldmann ThomasWaldmann added help wanted os: bsd FreeBSD, NetBSD, OpenBSD, ... labels Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted os: bsd FreeBSD, NetBSD, OpenBSD, ...
Projects
None yet
Development

No branches or pull requests

1 participant