ソースを参照

test_sparse_file: skip test on win32

about 10-50% of the github windows CI runs fail due to
this - root cause unknown.

Example failure:

        # we first check if we could create a sparse input file:
        sparse_support = is_sparse(filename, total_size, hole_size)
        if sparse_support:
            # we could create a sparse input file, so creating a backup of it and
            # extracting it again (as sparse) should also work:
            self.cmd(f"--repo={self.repository_location}", "rcreate", RK_ENCRYPTION)
            self.cmd(f"--repo={self.repository_location}", "create", "test", "input")
            with changedir(self.output_path):
                self.cmd(f"--repo={self.repository_location}", "extract", "test", "--sparse")
            self.assert_dirs_equal("input", "output/input")
            filename = os.path.join(self.output_path, "input", "sparse")
            with open(filename, "rb") as fd:
                # check if file contents are as expected
>               self.assert_equal(fd.read(hole_size), b"\0" * hole_size)
E               AssertionError: b'\x0[8388602 chars]x00\xf0Y\xb5\xe3\xee\xf3\x1f\xe3L\xcf\xae\x92\[159253621 chars]\x00' != b'\x0[8388602 chars]x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0[159383505 chars]\x00'

src/borg/testsuite/archiver/extract_cmd.py:212: AssertionError
Thomas Waldmann 1 年間 前
コミット
45cda981f9
1 ファイル変更2 行追加0 行削除
  1. 2 0
      src/borg/testsuite/archiver/extract_cmd.py

+ 2 - 0
src/borg/testsuite/archiver/extract_cmd.py

@@ -163,6 +163,8 @@ class ArchiverTestCase(ArchiverTestCaseBase):
         assert same_ts_ns(sti.st_mtime_ns, sto.st_mtime_ns)
         assert same_ts_ns(sto.st_mtime_ns, mtime * 1e9)
 
+    #
+    @pytest.mark.skipif(is_win32, reason="frequent test failures on github CI on win32")
     def test_sparse_file(self):
         def is_sparse(fn, total_size, hole_size):
             st = os.stat(fn)