borg
borg copied to clipboard
haiku OS test failures (master)
16:32:32.8376334Z =================================== FAILURES ===================================
2025-11-07T16:32:32.8377185Z ______________________ test_basic_functionality[archiver] ______________________
2025-11-07T16:32:32.8378433Z
2025-11-07T16:32:32.8379109Z archivers = 'archiver'
2025-11-07T16:32:32.8379804Z request = <FixtureRequest for <Function test_basic_functionality[archiver]>>
2025-11-07T16:32:32.8380506Z
2025-11-07T16:32:32.8380797Z def test_basic_functionality(archivers, request):
2025-11-07T16:32:32.8381411Z archiver = request.getfixturevalue(archivers)
2025-11-07T16:32:32.8382001Z if archiver.EXE:
2025-11-07T16:32:32.8382836Z pytest.skip("test_basic_functionality seems incompatible with fakeroot and/or the binary.")
2025-11-07T16:32:32.8383805Z have_root = create_test_files(archiver.input_path)
2025-11-07T16:32:32.8384410Z # Fork required to test --show-rc output.
2025-11-07T16:32:32.8385134Z output = cmd(archiver, "repo-create", RK_ENCRYPTION, "--show-version", "--show-rc", fork=True)
2025-11-07T16:32:32.8385856Z assert "borgbackup version" in output
2025-11-07T16:32:32.8386381Z assert "terminating with success status, rc 0" in output
2025-11-07T16:32:32.8386871Z
2025-11-07T16:32:32.8387140Z cmd(archiver, "create", "test", "input")
2025-11-07T16:32:32.8387621Z output = cmd(archiver, "create", "--stats", "test.2", "input")
2025-11-07T16:32:32.8388126Z assert "Archive name: test.2" in output
2025-11-07T16:32:32.8388539Z
2025-11-07T16:32:32.8389118Z with changedir("output"):
2025-11-07T16:32:32.8389539Z cmd(archiver, "extract", "test")
2025-11-07T16:32:32.8389932Z
2025-11-07T16:32:32.8390206Z list_output = cmd(archiver, "repo-list")
2025-11-07T16:32:32.8390616Z assert "test" in list_output
2025-11-07T16:32:32.8390987Z assert "test.2" in list_output
2025-11-07T16:32:32.8391334Z
2025-11-07T16:32:32.8391565Z expected = [
2025-11-07T16:32:32.8391842Z "input",
2025-11-07T16:32:32.8392101Z "input/bdev",
2025-11-07T16:32:32.8392403Z "input/cdev",
2025-11-07T16:32:32.8392695Z "input/dir2",
2025-11-07T16:32:32.8393002Z "input/dir2/file2",
2025-11-07T16:32:32.8393333Z "input/empty",
2025-11-07T16:32:32.8393654Z "input/file1",
2025-11-07T16:32:32.8393965Z "input/flagfile",
2025-11-07T16:32:32.8394277Z ]
2025-11-07T16:32:32.8394542Z if are_fifos_supported():
2025-11-07T16:32:32.8394908Z expected.append("input/fifo1")
2025-11-07T16:32:32.8395301Z if are_symlinks_supported():
2025-11-07T16:32:32.8395973Z expected.append("input/link1")
2025-11-07T16:32:32.8396362Z if are_hardlinks_supported():
2025-11-07T16:32:32.8396744Z expected.append("input/hardlink")
2025-11-07T16:32:32.8397150Z if not have_root or not has_mknod:
2025-11-07T16:32:32.8397614Z # We could not create these device files without (fake)root.
2025-11-07T16:32:32.8398089Z expected.remove("input/bdev")
2025-11-07T16:32:32.8398493Z expected.remove("input/cdev")
2025-11-07T16:32:32.8399146Z if has_lchflags:
2025-11-07T16:32:32.8399593Z # remove the file we did not back up, so input and output become equal
2025-11-07T16:32:32.8400202Z expected.remove("input/flagfile") # this file is UF_NODUMP
2025-11-07T16:32:32.8400747Z os.remove(os.path.join("input", "flagfile"))
2025-11-07T16:32:32.8401142Z
2025-11-07T16:32:32.8401456Z list_output = cmd(archiver, "list", "test", "--short")
2025-11-07T16:32:32.8401910Z for name in expected:
2025-11-07T16:32:32.8402249Z assert name in list_output
2025-11-07T16:32:32.8402654Z assert_dirs_equal("input", "output/input")
2025-11-07T16:32:32.8403281Z
2025-11-07T16:32:32.8403589Z info_output = cmd(archiver, "info", "-a", "test")
2025-11-07T16:32:32.8404098Z item_count = 5 if has_lchflags else 6 # one file is UF_NODUMP
2025-11-07T16:32:32.8404672Z > assert "Number of files: %d" % item_count in info_output
2025-11-07T16:32:32.8407268Z E assert ('Number of files: %d' % 6) in "Archive name: test\nArchive fingerprint: c680aa85b36ab65cf99c63b776b9fbf84562814092aa7b0a2365537f97aa43a0\nComment: \nHostname: shredder\nUsername: user\nTags: \nTime (start): Fri, 2025-11-07 16:25:37 +0000\nTime (end): Fri, 2025-11-07 16:25:37 +0000\nDuration: 0.009 seconds\nCommand line: /boot/system/non-packaged/bin/pytest -v --benchmark-skip -k 'not remote and not socket'\nNumber of files: 5\nOriginal size: 164.90 kB\n"
2025-11-07T16:32:32.8409854Z
2025-11-07T16:32:32.8410421Z /boot/home/home/runner/work/borg/borg/src/borg/testsuite/archiver/create_cmd_test.py:103: AssertionError
2025-11-07T16:32:32.8411321Z ________________________________ test_with_lock ________________________________
2025-11-07T16:32:32.8411681Z
2025-11-07T16:32:32.8412031Z tmp_path = PosixPath('/boot/system/cache/tmp/pytest-of-user/pytest-0/test_with_lock0')
2025-11-07T16:32:32.8412516Z
2025-11-07T16:32:32.8412654Z def test_with_lock(tmp_path):
2025-11-07T16:32:32.8413018Z repo_path = tmp_path / "repo"
2025-11-07T16:32:32.8413397Z env = os.environ.copy()
2025-11-07T16:32:32.8413768Z env["BORG_REPO"] = "file://" + str(repo_path)
2025-11-07T16:32:32.8414305Z command0 = "python3", "-m", "borg", "repo-create", "--encryption=none"
2025-11-07T16:32:32.8415065Z # Timings must be adjusted so that command1 keeps running while command2 tries to get the lock,
2025-11-07T16:32:32.8415849Z # so that lock acquisition for command2 fails as the test expects it.
2025-11-07T16:32:32.8416428Z lock_wait, execution_time, startup_wait = 2, 4, 1
2025-11-07T16:32:32.8416896Z assert lock_wait < execution_time - startup_wait
2025-11-07T16:32:32.8417642Z command1 = "python3", "-c", f'import time; print("first command - acquires the lock"); time.sleep({execution_time})'
2025-11-07T16:32:32.8418486Z command2 = "python3", "-c", 'print("second command - should never get executed")'
2025-11-07T16:32:32.8419436Z borgwl = "python3", "-m", "borg", "with-lock", f"--lock-wait={lock_wait}"
2025-11-07T16:32:32.8420220Z popen_options = dict(stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, env=env)
2025-11-07T16:32:32.8421231Z > subprocess.run(command0, env=env, check=True, text=True, capture_output=True)
2025-11-07T16:32:32.8421689Z
2025-11-07T16:32:32.8421874Z src/borg/testsuite/archiver/lock_cmds_test.py:31:
2025-11-07T16:32:32.8422388Z _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2025-11-07T16:32:32.8423157Z
2025-11-07T16:32:32.8423460Z input = None, capture_output = True, timeout = None, check = True
2025-11-07T16:32:32.8424137Z popenargs = (('python3', '-m', 'borg', 'repo-create', '--encryption=none'),)
2025-11-07T16:32:32.8425564Z kwargs = {'env': {'BORG_BASE_DIR': '/boot/system/cache/tmp/pytest-of-user/pytest-0/borg-base-dir452', 'BORG_REPO': 'file:///boo.../repo', 'BORG_STORE_DATA_LEVELS': '0', 'BORG_TESTONLY_WEAKEN_KDF': '1', ...}, 'stderr': -1, 'stdout': -1, 'text': True}
2025-11-07T16:32:32.8427083Z process = <Popen: returncode: 1 args: ('python3', '-m', 'borg', 'repo-create', '--encr...>
2025-11-07T16:32:32.8427670Z stdout = ''
2025-11-07T16:32:32.8428189Z stderr = '/boot/home/home/runner/work/borg/borg/.venv/bin/python3: No module named borg\n'
2025-11-07T16:32:32.8429031Z retcode = 1
2025-11-07T16:32:32.8429188Z
2025-11-07T16:32:32.8429304Z def run(*popenargs,
2025-11-07T16:32:32.8429772Z input=None, capture_output=False, timeout=None, check=False, **kwargs):
2025-11-07T16:32:32.8430452Z """Run command with arguments and return a CompletedProcess instance.
2025-11-07T16:32:32.8430937Z
2025-11-07T16:32:32.8431568Z The returned instance will have attributes args, returncode, stdout and
2025-11-07T16:32:32.8432259Z stderr. By default, stdout and stderr are not captured, and those attributes
2025-11-07T16:32:32.8432944Z will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them,
2025-11-07T16:32:32.8433509Z or pass capture_output=True to capture both.
2025-11-07T16:32:32.8433923Z
2025-11-07T16:32:32.8434244Z If check is True and the exit code was non-zero, it raises a
2025-11-07T16:32:32.8434946Z CalledProcessError. The CalledProcessError object will have the return code
2025-11-07T16:32:32.8435694Z in the returncode attribute, and output & stderr attributes if those streams
2025-11-07T16:32:32.8436242Z were captured.
2025-11-07T16:32:32.8436522Z
2025-11-07T16:32:32.8436903Z If timeout is given, and the process takes too long, a TimeoutExpired
2025-11-07T16:32:32.8437427Z exception will be raised.
2025-11-07T16:32:32.8437755Z
2025-11-07T16:32:32.8438088Z There is an optional argument "input", allowing you to
2025-11-07T16:32:32.8438684Z pass bytes or a string to the subprocess's stdin. If you use this argument
2025-11-07T16:32:32.8439570Z you may not also use the Popen constructor's "stdin" argument, as
2025-11-07T16:32:32.8440062Z it will be used internally.
2025-11-07T16:32:32.8440394Z
2025-11-07T16:32:32.8440797Z By default, all communication is in bytes, and therefore any "input" should
2025-11-07T16:32:32.8441502Z be bytes, and the stdout and stderr will be bytes. If in text mode, any
2025-11-07T16:32:32.8442184Z "input" should be a string, and stdout and stderr will be strings decoded
2025-11-07T16:32:32.8442842Z according to locale encoding, or by "encoding" if set. Text mode is
2025-11-07T16:32:32.8443547Z triggered by setting any of text, encoding, errors or universal_newlines.
2025-11-07T16:32:32.8444053Z
2025-11-07T16:32:32.8444428Z The other arguments are the same as for the Popen constructor.
2025-11-07T16:32:32.8444898Z """
2025-11-07T16:32:32.8445154Z if input is not None:
2025-11-07T16:32:32.8445497Z if kwargs.get('stdin') is not None:
2025-11-07T16:32:32.8446035Z raise ValueError('stdin and input arguments may not both be used.')
2025-11-07T16:32:32.8446562Z kwargs['stdin'] = PIPE
2025-11-07T16:32:32.8446882Z
2025-11-07T16:32:32.8447123Z if capture_output:
2025-11-07T16:32:32.8447582Z if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None:
2025-11-07T16:32:32.8448258Z raise ValueError('stdout and stderr arguments may not be used '
2025-11-07T16:32:32.8448977Z 'with capture_output.')
2025-11-07T16:32:32.8449617Z kwargs['stdout'] = PIPE
2025-11-07T16:32:32.8449964Z kwargs['stderr'] = PIPE
2025-11-07T16:32:32.8450299Z
2025-11-07T16:32:32.8450590Z with Popen(*popenargs, **kwargs) as process:
2025-11-07T16:32:32.8450996Z try:
2025-11-07T16:32:32.8451383Z stdout, stderr = process.communicate(input, timeout=timeout)
2025-11-07T16:32:32.8451888Z except TimeoutExpired as exc:
2025-11-07T16:32:32.8452266Z process.kill()
2025-11-07T16:32:32.8452591Z if _mswindows:
2025-11-07T16:32:32.8452978Z # Windows accumulates the output in a single blocking
2025-11-07T16:32:32.8453477Z # read() call run on child threads, with the timeout
2025-11-07T16:32:32.8453988Z # being done in a join() on those threads. communicate()
2025-11-07T16:32:32.8454515Z # _after_ kill() is required to collect that and add it
2025-11-07T16:32:32.8454972Z # to the exception.
2025-11-07T16:32:32.8455389Z exc.stdout, exc.stderr = process.communicate()
2025-11-07T16:32:32.8455795Z else:
2025-11-07T16:32:32.8456461Z # POSIX _communicate already populated the output so
2025-11-07T16:32:32.8456948Z # far into the TimeoutExpired exception.
2025-11-07T16:32:32.8457363Z process.wait()
2025-11-07T16:32:32.8457675Z raise
2025-11-07T16:32:32.8458104Z except: # Including KeyboardInterrupt, communicate handled that.
2025-11-07T16:32:32.8458626Z process.kill()
2025-11-07T16:32:33.1351244Z # We don't call process.wait() as .__exit__ does that for us.
2025-11-07T16:32:33.1353134Z raise
2025-11-07T16:32:33.1353455Z retcode = process.poll()
2025-11-07T16:32:33.1353818Z if check and retcode:
2025-11-07T16:32:33.1354216Z > raise CalledProcessError(retcode, process.args,
2025-11-07T16:32:33.1354711Z output=stdout, stderr=stderr)
2025-11-07T16:32:33.1355593Z E subprocess.CalledProcessError: Command '('python3', '-m', 'borg', 'repo-create', '--encryption=none')' returned non-zero exit status 1.
2025-11-07T16:32:33.1356293Z
2025-11-07T16:32:33.1356557Z /boot/system/lib/python3.10/subprocess.py:526: CalledProcessError
2025-11-07T16:32:33.1357158Z ______________________________ test_get_base_dir _______________________________
2025-11-07T16:32:33.1357530Z
2025-11-07T16:32:33.1357871Z monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x1783bc4efb0>
2025-11-07T16:32:33.1358279Z
2025-11-07T16:32:33.1358418Z def test_get_base_dir(monkeypatch):
2025-11-07T16:32:33.1359035Z """test that get_base_dir respects environment"""
2025-11-07T16:32:33.1359514Z monkeypatch.delenv("BORG_BASE_DIR", raising=False)
2025-11-07T16:32:33.1359954Z monkeypatch.delenv("HOME", raising=False)
2025-11-07T16:32:33.1360402Z monkeypatch.delenv("USER", raising=False)
2025-11-07T16:32:33.1360865Z assert get_base_dir(legacy=True) == os.path.expanduser("~")
2025-11-07T16:32:33.1361355Z monkeypatch.setenv("USER", "root")
2025-11-07T16:32:33.1361821Z > assert get_base_dir(legacy=True) == os.path.expanduser("~root")
2025-11-07T16:32:33.1362188Z
2025-11-07T16:32:33.1362322Z src/borg/testsuite/helpers/fs_test.py:36:
2025-11-07T16:32:33.1362725Z _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2025-11-07T16:32:33.1363144Z src/borg/helpers/fs.py:63: in get_base_dir
2025-11-07T16:32:33.1363607Z base_dir = str(Path(f"~{os.environ.get('USER', '')}").expanduser())
2025-11-07T16:32:33.1364112Z _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2025-11-07T16:32:33.1364401Z
2025-11-07T16:32:33.1364514Z self = PosixPath('~root')
2025-11-07T16:32:33.1364699Z
2025-11-07T16:32:33.1365247Z def expanduser(self):
2025-11-07T16:32:33.1365624Z """ Return a new path with expanded ~ and ~user constructs
2025-11-07T16:32:33.1366066Z (as returned by os.path.expanduser)
2025-11-07T16:32:33.1366402Z """
2025-11-07T16:32:33.1366664Z if (not (self._drv or self._root) and
2025-11-07T16:32:33.1367052Z self._parts and self._parts[0][:1] == '~'):
2025-11-07T16:32:33.1367517Z homedir = self._accessor.expanduser(self._parts[0])
2025-11-07T16:32:33.1367935Z if homedir[:1] == "~":
2025-11-07T16:32:33.1368361Z > raise RuntimeError("Could not determine home directory.")
2025-11-07T16:32:33.1369136Z E RuntimeError: Could not determine home directory.
2025-11-07T16:32:33.1369454Z
2025-11-07T16:32:33.1369651Z /boot/system/lib/python3.10/pathlib.py:1440: RuntimeError
2025-11-07T16:32:33.1370151Z =========================== short test summary info ============================
2025-11-07T16:32:33.1370854Z FAILED src/borg/testsuite/archiver/create_cmd_test.py::test_basic_functionality[archiver]
2025-11-07T16:32:33.1371696Z FAILED src/borg/testsuite/archiver/lock_cmds_test.py::test_with_lock - subpro...
2025-11-07T16:32:33.1372713Z FAILED src/borg/testsuite/helpers/fs_test.py::test_get_base_dir - RuntimeErro...
2025-11-07T16:32:33.1373426Z === 3 failed, 1260 passed, 374 skipped, 341 deselected in 530.72s (0:08:50) ====