gitpython-developers / gitdb

IO of git-style object databases
http://gitdb.readthedocs.org
Other
212 stars 65 forks source link

4.0.7: test suite is failing #70

Open kloczek opened 3 years ago

kloczek commented 3 years ago

Both nose and pytest based are failing

+ PYTHONHASHSEED=0
+ /usr/bin/python3 -s -B -m compileall2 -f -j48 -o 0 -o 1 -o 2 -s /home/tkloczko/rpmbuild/BUILDROOT/python-gitdb-4.0.7-2.fc35.x86_64 -p / /home/tkloczko/rpmbuild/BUILDROOT/python-gitdb-4.0.7-2.fc35.x86_64/usr/lib64/python3.8/site-packages /home/tkloczko/rpmbuild/BUILDROOT/python-gitdb-4.0.7-2.fc35.x86_64/usr/lib/python3.8/site-packages
Listing '/home/tkloczko/rpmbuild/BUILDROOT/python-gitdb-4.0.7-2.fc35.x86_64/usr/lib64/python3.8/site-packages'...
Can't list '/home/tkloczko/rpmbuild/BUILDROOT/python-gitdb-4.0.7-2.fc35.x86_64/usr/lib64/python3.8/site-packages'
Listing '/home/tkloczko/rpmbuild/BUILDROOT/python-gitdb-4.0.7-2.fc35.x86_64/usr/lib/python3.8/site-packages'...
Listing '/home/tkloczko/rpmbuild/BUILDROOT/python-gitdb-4.0.7-2.fc35.x86_64/usr/lib/python3.8/site-packages/gitdb'...
Compiling '/home/tkloczko/rpmbuild/BUILDROOT/python-gitdb-4.0.7-2.fc35.x86_64/usr/lib/python3.8/site-packages/gitdb/__init__.py'...
Compiling '/home/tkloczko/rpmbuild/BUILDROOT/python-gitdb-4.0.7-2.fc35.x86_64/usr/lib/python3.8/site-packages/gitdb/base.py'...
Listing '/home/tkloczko/rpmbuild/BUILDROOT/python-gitdb-4.0.7-2.fc35.x86_64/usr/lib/python3.8/site-packages/gitdb/db'...
Compiling '/home/tkloczko/rpmbuild/BUILDROOT/python-gitdb-4.0.7-2.fc35.x86_64/usr/lib/python3.8/site-packages/gitdb/const.py'...
Compiling '/home/tkloczko/rpmbuild/BUILDROOT/python-gitdb-4.0.7-2.fc35.x86_64/usr/lib/python3.8/site-packages/gitdb/db/__init__.py'...
Compiling '/home/tkloczko/rpmbuild/BUILDROOT/python-gitdb-4.0.7-2.fc35.x86_64/usr/lib/python3.8/site-packages/gitdb/db/base.py'...
Compiling '/home/tkloczko/rpmbuild/BUILDROOT/python-gitdb-4.0.7-2.fc35.x86_64/usr/lib/python3.8/site-packages/gitdb/db/git.py'...
Compiling '/home/tkloczko/rpmbuild/BUILDROOT/python-gitdb-4.0.7-2.fc35.x86_64/usr/lib/python3.8/site-packages/gitdb/db/loose.py'...
Compiling '/home/tkloczko/rpmbuild/BUILDROOT/python-gitdb-4.0.7-2.fc35.x86_64/usr/lib/python3.8/site-packages/gitdb/db/mem.py'...
Compiling '/home/tkloczko/rpmbuild/BUILDROOT/python-gitdb-4.0.7-2.fc35.x86_64/usr/lib/python3.8/site-packages/gitdb/db/pack.py'...
Compiling '/home/tkloczko/rpmbuild/BUILDROOT/python-gitdb-4.0.7-2.fc35.x86_64/usr/lib/python3.8/site-packages/gitdb/db/ref.py'...
Compiling '/home/tkloczko/rpmbuild/BUILDROOT/python-gitdb-4.0.7-2.fc35.x86_64/usr/lib/python3.8/site-packages/gitdb/exc.py'...
Listing '/home/tkloczko/rpmbuild/BUILDROOT/python-gitdb-4.0.7-2.fc35.x86_64/usr/lib/python3.8/site-packages/gitdb/test'...
Compiling '/home/tkloczko/rpmbuild/BUILDROOT/python-gitdb-4.0.7-2.fc35.x86_64/usr/lib/python3.8/site-packages/gitdb/fun.py'...
Compiling '/home/tkloczko/rpmbuild/BUILDROOT/python-gitdb-4.0.7-2.fc35.x86_64/usr/lib/python3.8/site-packages/gitdb/pack.py'...
Compiling '/home/tkloczko/rpmbuild/BUILDROOT/python-gitdb-4.0.7-2.fc35.x86_64/usr/lib/python3.8/site-packages/gitdb/stream.py'...
Compiling '/home/tkloczko/rpmbuild/BUILDROOT/python-gitdb-4.0.7-2.fc35.x86_64/usr/lib/python3.8/site-packages/gitdb/test/__init__.py'...
Compiling '/home/tkloczko/rpmbuild/BUILDROOT/python-gitdb-4.0.7-2.fc35.x86_64/usr/lib/python3.8/site-packages/gitdb/test/lib.py'...
Compiling '/home/tkloczko/rpmbuild/BUILDROOT/python-gitdb-4.0.7-2.fc35.x86_64/usr/lib/python3.8/site-packages/gitdb/test/test_base.py'...
Compiling '/home/tkloczko/rpmbuild/BUILDROOT/python-gitdb-4.0.7-2.fc35.x86_64/usr/lib/python3.8/site-packages/gitdb/test/test_example.py'...
Compiling '/home/tkloczko/rpmbuild/BUILDROOT/python-gitdb-4.0.7-2.fc35.x86_64/usr/lib/python3.8/site-packages/gitdb/test/test_pack.py'...
Compiling '/home/tkloczko/rpmbuild/BUILDROOT/python-gitdb-4.0.7-2.fc35.x86_64/usr/lib/python3.8/site-packages/gitdb/test/test_stream.py'...
Compiling '/home/tkloczko/rpmbuild/BUILDROOT/python-gitdb-4.0.7-2.fc35.x86_64/usr/lib/python3.8/site-packages/gitdb/typ.py'...
Compiling '/home/tkloczko/rpmbuild/BUILDROOT/python-gitdb-4.0.7-2.fc35.x86_64/usr/lib/python3.8/site-packages/gitdb/test/test_util.py'...
Listing '/home/tkloczko/rpmbuild/BUILDROOT/python-gitdb-4.0.7-2.fc35.x86_64/usr/lib/python3.8/site-packages/gitdb/utils'...
Compiling '/home/tkloczko/rpmbuild/BUILDROOT/python-gitdb-4.0.7-2.fc35.x86_64/usr/lib/python3.8/site-packages/gitdb/util.py'...
Listing '/home/tkloczko/rpmbuild/BUILDROOT/python-gitdb-4.0.7-2.fc35.x86_64/usr/lib/python3.8/site-packages/gitdb-4.0.7-py3.8.egg-info'...
Compiling '/home/tkloczko/rpmbuild/BUILDROOT/python-gitdb-4.0.7-2.fc35.x86_64/usr/lib/python3.8/site-packages/gitdb/utils/encoding.py'...
Compiling '/home/tkloczko/rpmbuild/BUILDROOT/python-gitdb-4.0.7-2.fc35.x86_64/usr/lib/python3.8/site-packages/gitdb/utils/__init__.py'...
+ /usr/lib/rpm/redhat/brp-mangle-shebangs
Executing(%check): /bin/sh -e /var/tmp/rpm-tmp.i6TxHm
+ umask 022
+ cd /home/tkloczko/rpmbuild/BUILD
+ cd gitdb-4.0.7
+ /usr/bin/python3 -m nose -v --exclude=test_pack_writing
test_reading (gitdb.test.db.test_git.TestGitDB) ... ERROR
test_writing (gitdb.test.db.test_git.TestGitDB) ... ok
test_basics (gitdb.test.db.test_loose.TestLooseDB) ... ok
test_writing (gitdb.test.db.test_mem.TestMemoryDB) ... ok
test_writing (gitdb.test.db.test_pack.TestPackDB) ... ok
test_writing (gitdb.test.db.test_ref.TestReferenceDB) ... Test TestReferenceDB.test_writing failed, output is at '/tmp/test_writingxzw7nxp_'
FAIL
test_correctness (gitdb.test.performance.test_pack.TestPackedDBPerformance) ... Endurance run: verify streaming of objects (crc and sha)
ERROR
based on the pack(s) of our packed object DB, we will just copy and verify all objects in the back ... ERROR
test_pack_random_access (gitdb.test.performance.test_pack.TestPackedDBPerformance) ... ERROR
test_stream_reading (gitdb.test.performance.test_pack_streaming.TestPackStreamingPerformance) ... ERROR
test_large_data_streaming (gitdb.test.performance.test_stream.TestObjDBPerformance) ... Creating  data ...
Done (in 1.341565 s)
Added 50000 KiB (filesize = 17294 KiB) of  data to loose odb in 0.946455 s ( 52828.686744 Write KiB / s)
Read 50000 KiB of  data at once from loose odb in 0.325943 s ( 153400.945794 Read KiB / s)
Read 50000 KiB of  data in 512 KiB chunks from loose odb in 0.256665 s ( 194806.466326 Read KiB / s)
Creating random  data ...
Done (in 14.684306 s)
Added 50000 KiB (filesize = 43182 KiB) of random  data to loose odb in 2.287315 s ( 21859.692419 Write KiB / s)
Read 50000 KiB of random  data at once from loose odb in 0.520694 s ( 96025.641613 Read KiB / s)
Read 50000 KiB of random  data in 512 KiB chunks from loose odb in 0.409039 s ( 122237.726695 Read KiB / s)
ok
test_streams (gitdb.test.test_base.TestBaseTypes) ... ok
test_base (gitdb.test.test_example.TestExamples) ... ERROR
test_pack (gitdb.test.test_pack.TestPack) ... ok
test_pack_64 (gitdb.test.test_pack.TestPack) ... SKIP
test_pack_entity (gitdb.test.test_pack.TestPack) ... ok
test_pack_index (gitdb.test.test_pack.TestPack) ... ok
test_compressed_writer (gitdb.test.test_stream.TestStream) ... ok
test_decompress_reader (gitdb.test.test_stream.TestStream) ... ok
test_decompress_reader_special_case (gitdb.test.test_stream.TestStream) ... ok
test_sha_writer (gitdb.test.test_stream.TestStream) ... ok
test_basics (gitdb.test.test_util.TestUtils) ... ok
test_lockedfd (gitdb.test.test_util.TestUtils) ... ok

======================================================================
ERROR: test_reading (gitdb.test.db.test_git.TestGitDB)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/gitdb/test/db/test_git.py", line 22, in test_reading
    assert 1 < len(gdb.databases()) < 4
  File "/home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/gitdb/db/base.py", line 223, in databases
    return tuple(self._dbs)
  File "/home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/gitdb/util.py", line 253, in __getattr__
    self._set_cache_(attr)
  File "/home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/gitdb/db/git.py", line 62, in _set_cache_
    raise InvalidDBRoot(self.root_path())
gitdb.exc.InvalidDBRoot: /home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/.git/objects
-------------------- >> begin captured logging << --------------------
root: INFO: You can set the GITDB_TEST_GIT_REPO_BASE environment variable to a .git repository of your choice - defaulting to the gitdb repository
--------------------- >> end captured logging << ---------------------

======================================================================
ERROR: test_correctness (gitdb.test.performance.test_pack.TestPackedDBPerformance)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/gitdb/test/lib.py", line 71, in wrapper
    return func(self, *args, **kwargs)
  File "/home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/gitdb/test/performance/test_pack.py", line 117, in test_correctness
    for entity in pdb.entities():
  File "/home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/gitdb/db/pack.py", line 179, in entities
    return [item[1] for item in self._entities]
  File "/home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/gitdb/util.py", line 253, in __getattr__
    self._set_cache_(attr)
  File "/home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/gitdb/db/pack.py", line 54, in _set_cache_
    self.update_cache(force=True)
  File "/home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/gitdb/db/pack.py", line 141, in update_cache
    stat = os.stat(self.root_path())
FileNotFoundError: [Errno 2] No such file or directory: '/home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/.git/objects/pack'
-------------------- >> begin captured logging << --------------------
root: INFO: You can set the GITDB_TEST_GIT_REPO_BASE environment variable to a .git repository of your choice - defaulting to the gitdb repository
--------------------- >> end captured logging << ---------------------

======================================================================
ERROR: based on the pack(s) of our packed object DB, we will just copy and verify all objects in the back
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/gitdb/test/lib.py", line 71, in wrapper
    return func(self, *args, **kwargs)
  File "/home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/gitdb/test/performance/test_pack.py", line 93, in test_loose_correctness
    for c, sha in enumerate(pdb.sha_iter()):
  File "/home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/gitdb/db/base.py", line 215, in sha_iter
    return chain(*(db.sha_iter() for db in self._dbs))
  File "/home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/gitdb/util.py", line 253, in __getattr__
    self._set_cache_(attr)
  File "/home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/gitdb/db/git.py", line 62, in _set_cache_
    raise InvalidDBRoot(self.root_path())
gitdb.exc.InvalidDBRoot: /home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/.git/objects

======================================================================
ERROR: test_pack_random_access (gitdb.test.performance.test_pack.TestPackedDBPerformance)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/gitdb/test/lib.py", line 71, in wrapper
    return func(self, *args, **kwargs)
  File "/home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/gitdb/test/performance/test_pack.py", line 35, in test_pack_random_access
    sha_list = list(pdb.sha_iter())
  File "/home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/gitdb/db/pack.py", line 106, in sha_iter
    for entity in self.entities():
  File "/home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/gitdb/db/pack.py", line 179, in entities
    return [item[1] for item in self._entities]
  File "/home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/gitdb/util.py", line 253, in __getattr__
    self._set_cache_(attr)
  File "/home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/gitdb/db/pack.py", line 54, in _set_cache_
    self.update_cache(force=True)
  File "/home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/gitdb/db/pack.py", line 141, in update_cache
    stat = os.stat(self.root_path())
FileNotFoundError: [Errno 2] No such file or directory: '/home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/.git/objects/pack'

======================================================================
ERROR: test_stream_reading (gitdb.test.performance.test_pack_streaming.TestPackStreamingPerformance)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/gitdb/test/lib.py", line 71, in wrapper
    return func(self, *args, **kwargs)
  File "/home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/gitdb/test/performance/test_pack_streaming.py", line 75, in test_stream_reading
    for sha in pdb.sha_iter():
  File "/home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/gitdb/db/pack.py", line 106, in sha_iter
    for entity in self.entities():
  File "/home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/gitdb/db/pack.py", line 179, in entities
    return [item[1] for item in self._entities]
  File "/home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/gitdb/util.py", line 253, in __getattr__
    self._set_cache_(attr)
  File "/home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/gitdb/db/pack.py", line 54, in _set_cache_
    self.update_cache(force=True)
  File "/home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/gitdb/db/pack.py", line 141, in update_cache
    stat = os.stat(self.root_path())
FileNotFoundError: [Errno 2] No such file or directory: '/home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/.git/objects/pack'
-------------------- >> begin captured logging << --------------------
root: INFO: You can set the GITDB_TEST_GIT_REPO_BASE environment variable to a .git repository of your choice - defaulting to the gitdb repository
--------------------- >> end captured logging << ---------------------

======================================================================
ERROR: test_base (gitdb.test.test_example.TestExamples)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/gitdb/test/test_example.py", line 40, in test_base
    ldb.store(istream)
  File "/home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/gitdb/db/loose.py", line 185, in store
    fd, tmp_path = tempfile.mkstemp(prefix='obj', dir=self._root_path)
  File "/usr/lib64/python3.8/tempfile.py", line 331, in mkstemp
    return _mkstemp_inner(dir, prefix, suffix, flags, output_type)
  File "/usr/lib64/python3.8/tempfile.py", line 250, in _mkstemp_inner
    fd = _os.open(file, flags, 0o600)
FileNotFoundError: [Errno 2] No such file or directory: '/home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/.git/objects/obj_6ffq2n6'
-------------------- >> begin captured logging << --------------------
root: INFO: You can set the GITDB_TEST_GIT_REPO_BASE environment variable to a .git repository of your choice - defaulting to the gitdb repository
--------------------- >> end captured logging << ---------------------

======================================================================
FAIL: test_writing (gitdb.test.db.test_ref.TestReferenceDB)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/gitdb/test/lib.py", line 86, in wrapper
    return func(self, path)
  File "/home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/gitdb/test/db/test_ref.py", line 44, in test_writing
    assert len(rdb.databases()) == 1
AssertionError:
-------------------- >> begin captured logging << --------------------
root: INFO: You can set the GITDB_TEST_GIT_REPO_BASE environment variable to a .git repository of your choice - defaulting to the gitdb repository
--------------------- >> end captured logging << ---------------------

----------------------------------------------------------------------
Ran 23 tests in 22.219s

FAILED (SKIP=1, errors=6, failures=1)
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-gitdb-4.0.7-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-gitdb-4.0.7-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/python3 -Bm pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.9, pytest-6.2.3, py-1.10.0, pluggy-0.13.1
rootdir: /home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7
plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, asyncio-0.14.0, expect-1.1.0, cov-2.11.1, mock-3.5.1, httpbin-1.0.0, xdist-2.2.1, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, pyfakefs-4.4.0, freezegun-0.4.2, flaky-3.7.0, cases-3.4.6, hypothesis-6.10.0
collected 24 items

gitdb/test/test_base.py .                                                                                                                                            [  4%]
gitdb/test/test_example.py F                                                                                                                                         [  8%]
gitdb/test/test_pack.py .s..                                                                                                                                         [ 25%]
gitdb/test/test_stream.py ....                                                                                                                                       [ 41%]
gitdb/test/test_util.py ..                                                                                                                                           [ 50%]
gitdb/test/db/test_git.py F.                                                                                                                                         [ 58%]
gitdb/test/db/test_loose.py .                                                                                                                                        [ 62%]
gitdb/test/db/test_mem.py .                                                                                                                                          [ 66%]
gitdb/test/db/test_pack.py .                                                                                                                                         [ 70%]
gitdb/test/db/test_ref.py F                                                                                                                                          [ 75%]
gitdb/test/performance/test_pack.py FFF                                                                                                                              [ 87%]
gitdb/test/performance/test_pack_streaming.py FF                                                                                                                     [ 95%]
gitdb/test/performance/test_stream.py .                                                                                                                              [100%]

================================================================================= FAILURES =================================================================================
__________________________________________________________________________ TestExamples.test_base __________________________________________________________________________

self = <gitdb.test.test_example.TestExamples testMethod=test_base>

    def test_base(self):
        ldb = LooseObjectDB(os.path.join(self.gitrepopath, 'objects'))

        for sha1 in ldb.sha_iter():
            oinfo = ldb.info(sha1)
            ostream = ldb.stream(sha1)
            assert oinfo[:3] == ostream[:3]

            assert len(ostream.read()) == ostream.size
            assert ldb.has_object(oinfo.binsha)
        # END for each sha in database
        # assure we close all files
        try:
            del(ostream)
            del(oinfo)
        except UnboundLocalError:
            pass
        # END ignore exception if there are no loose objects

        data = "my data".encode("ascii")
        istream = IStream("blob", len(data), BytesIO(data))

        # the object does not yet have a sha
        assert istream.binsha is None
>       ldb.store(istream)

gitdb/test/test_example.py:40:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
gitdb/db/loose.py:185: in store
    fd, tmp_path = tempfile.mkstemp(prefix='obj', dir=self._root_path)
/usr/lib64/python3.8/tempfile.py:331: in mkstemp
    return _mkstemp_inner(dir, prefix, suffix, flags, output_type)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

dir = '/home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/.git/objects', pre = 'obj', suf = '', flags = 131266, output_type = <class 'str'>

    def _mkstemp_inner(dir, pre, suf, flags, output_type):
        """Code common to mkstemp, TemporaryFile, and NamedTemporaryFile."""

        names = _get_candidate_names()
        if output_type is bytes:
            names = map(_os.fsencode, names)

        for seq in range(TMP_MAX):
            name = next(names)
            file = _os.path.join(dir, pre + name + suf)
            _sys.audit("tempfile.mkstemp", file)
            try:
>               fd = _os.open(file, flags, 0o600)
E               FileNotFoundError: [Errno 2] No such file or directory: '/home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/.git/objects/objzn0zuqpp'

/usr/lib64/python3.8/tempfile.py:250: FileNotFoundError
__________________________________________________________________________ TestGitDB.test_reading __________________________________________________________________________

self = <gitdb.test.db.test_git.TestGitDB testMethod=test_reading>

    def test_reading(self):
        gdb = GitDB(os.path.join(self.gitrepopath, 'objects'))

        # we have packs and loose objects, alternates doesn't necessarily exist
>       assert 1 < len(gdb.databases()) < 4

gitdb/test/db/test_git.py:22:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
gitdb/db/base.py:223: in databases
    return tuple(self._dbs)
gitdb/util.py:253: in __getattr__
    self._set_cache_(attr)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <gitdb.db.git.GitDB object at 0x7fe18ccf7190>, attr = '_dbs'

    def _set_cache_(self, attr):
        if attr == '_dbs' or attr == '_loose_db':
            self._dbs = list()
            loose_db = None
            for subpath, dbcls in ((self.packs_dir, self.PackDBCls),
                                   (self.loose_dir, self.LooseDBCls),
                                   (self.alternates_dir, self.ReferenceDBCls)):
                path = self.db_path(subpath)
                if os.path.exists(path):
                    self._dbs.append(dbcls(path))
                    if dbcls is self.LooseDBCls:
                        loose_db = self._dbs[-1]
                    # END remember loose db
                # END check path exists
            # END for each db type

            # should have at least one subdb
            if not self._dbs:
>               raise InvalidDBRoot(self.root_path())
E               gitdb.exc.InvalidDBRoot: /home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/.git/objects

gitdb/db/git.py:62: InvalidDBRoot
_______________________________________________________________________ TestReferenceDB.test_writing _______________________________________________________________________

self = <gitdb.test.db.test_ref.TestReferenceDB testMethod=test_writing>

    def wrapper(self):
        path = tempfile.mktemp(prefix=func.__name__)
        os.mkdir(path)
        keep = False
        try:
            try:
>               return func(self, path)

gitdb/test/lib.py:86:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <gitdb.test.db.test_ref.TestReferenceDB testMethod=test_writing>, path = '/tmp/test_writingp3q0qh3t'

    @with_rw_directory
    def test_writing(self, path):
        alt_path = os.path.join(path, 'alternates')
        rdb = ReferenceDB(alt_path)
        assert len(rdb.databases()) == 0
        assert rdb.size() == 0
        assert len(list(rdb.sha_iter())) == 0

        # try empty, non-existing
        assert not rdb.has_object(NULL_BIN_SHA)

        # setup alternate file
        # add two, one is invalid
        own_repo_path = os.path.join(self.gitrepopath, 'objects')       # use own repo
        self.make_alt_file(alt_path, [own_repo_path, "invalid/path"])
        rdb.update_cache()
>       assert len(rdb.databases()) == 1
E       AssertionError: assert 0 == 1
E        +  where 0 = len(())
E        +    where () = <bound method CompoundDB.databases of <gitdb.db.ref.ReferenceDB object at 0x7fe18cc8b520>>()
E        +      where <bound method CompoundDB.databases of <gitdb.db.ref.ReferenceDB object at 0x7fe18cc8b520>> = <gitdb.db.ref.ReferenceDB object at 0x7fe18cc8b520>.databases

gitdb/test/db/test_ref.py:44: AssertionError
--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------
Test TestReferenceDB.test_writing failed, output is at '/tmp/test_writingp3q0qh3t'
_________________________________________________________________ TestPackedDBPerformance.test_correctness _________________________________________________________________

self = <gitdb.test.performance.test_pack.TestPackedDBPerformance testMethod=test_correctness>

    @skip_on_travis_ci
    def test_correctness(self):
        pdb = PackedDB(os.path.join(self.gitrepopath, "objects/pack"))
        # disabled for now as it used to work perfectly, checking big repositories takes a long time
        print("Endurance run: verify streaming of objects (crc and sha)", file=sys.stderr)
        for crc in range(2):
            count = 0
            st = time()
>           for entity in pdb.entities():

gitdb/test/performance/test_pack.py:117:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
gitdb/db/pack.py:179: in entities
    return [item[1] for item in self._entities]
gitdb/util.py:253: in __getattr__
    self._set_cache_(attr)
gitdb/db/pack.py:54: in _set_cache_
    self.update_cache(force=True)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <gitdb.db.pack.PackedDB object at 0x7fe18cc43ee0>, force = True

    def update_cache(self, force=False):
        """
        Update our cache with the acutally existing packs on disk. Add new ones,
        and remove deleted ones. We keep the unchanged ones

        :param force: If True, the cache will be updated even though the directory
            does not appear to have changed according to its modification timestamp.
        :return: True if the packs have been updated so there is new information,
            False if there was no change to the pack database"""
>       stat = os.stat(self.root_path())
E       FileNotFoundError: [Errno 2] No such file or directory: '/home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/.git/objects/pack'

gitdb/db/pack.py:141: FileNotFoundError
--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------
Endurance run: verify streaming of objects (crc and sha)
______________________________________________________________ TestPackedDBPerformance.test_loose_correctness ______________________________________________________________

self = <gitdb.test.performance.test_pack.TestPackedDBPerformance testMethod=test_loose_correctness>

    @skip_on_travis_ci
    def test_loose_correctness(self):
        """based on the pack(s) of our packed object DB, we will just copy and verify all objects in the back
        into the loose object db (memory).
        This should help finding dormant issues like this one https://github.com/gitpython-developers/GitPython/issues/220
        faster
        :note: It doesn't seem this test can find the issue unless the given pack contains highly compressed
        data files, like archives."""
        from gitdb.util import bin_to_hex
        pdb = GitDB(os.path.join(self.gitrepopath, 'objects'))
        mdb = MemoryDB()
>       for c, sha in enumerate(pdb.sha_iter()):

gitdb/test/performance/test_pack.py:93:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
gitdb/db/base.py:215: in sha_iter
    return chain(*(db.sha_iter() for db in self._dbs))
gitdb/util.py:253: in __getattr__
    self._set_cache_(attr)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <gitdb.db.git.GitDB object at 0x7fe18ccf7a30>, attr = '_dbs'

    def _set_cache_(self, attr):
        if attr == '_dbs' or attr == '_loose_db':
            self._dbs = list()
            loose_db = None
            for subpath, dbcls in ((self.packs_dir, self.PackDBCls),
                                   (self.loose_dir, self.LooseDBCls),
                                   (self.alternates_dir, self.ReferenceDBCls)):
                path = self.db_path(subpath)
                if os.path.exists(path):
                    self._dbs.append(dbcls(path))
                    if dbcls is self.LooseDBCls:
                        loose_db = self._dbs[-1]
                    # END remember loose db
                # END check path exists
            # END for each db type

            # should have at least one subdb
            if not self._dbs:
>               raise InvalidDBRoot(self.root_path())
E               gitdb.exc.InvalidDBRoot: /home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/.git/objects

gitdb/db/git.py:62: InvalidDBRoot
_____________________________________________________________ TestPackedDBPerformance.test_pack_random_access ______________________________________________________________

self = <gitdb.test.performance.test_pack.TestPackedDBPerformance testMethod=test_pack_random_access>

    @skip_on_travis_ci
    def test_pack_random_access(self):
        pdb = PackedDB(os.path.join(self.gitrepopath, "objects/pack"))

        # sha lookup
        st = time()
>       sha_list = list(pdb.sha_iter())

gitdb/test/performance/test_pack.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
gitdb/db/pack.py:106: in sha_iter
    for entity in self.entities():
gitdb/db/pack.py:179: in entities
    return [item[1] for item in self._entities]
gitdb/util.py:253: in __getattr__
    self._set_cache_(attr)
gitdb/db/pack.py:54: in _set_cache_
    self.update_cache(force=True)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <gitdb.db.pack.PackedDB object at 0x7fe18ca3d1c0>, force = True

    def update_cache(self, force=False):
        """
        Update our cache with the acutally existing packs on disk. Add new ones,
        and remove deleted ones. We keep the unchanged ones

        :param force: If True, the cache will be updated even though the directory
            does not appear to have changed according to its modification timestamp.
        :return: True if the packs have been updated so there is new information,
            False if there was no change to the pack database"""
>       stat = os.stat(self.root_path())
E       FileNotFoundError: [Errno 2] No such file or directory: '/home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/.git/objects/pack'

gitdb/db/pack.py:141: FileNotFoundError
______________________________________________________________ TestPackStreamingPerformance.test_pack_writing ______________________________________________________________

self = <gitdb.test.performance.test_pack_streaming.TestPackStreamingPerformance testMethod=test_pack_writing>

    @skip_on_travis_ci
    def test_pack_writing(self):
        # see how fast we can write a pack from object streams.
        # This will not be fast, as we take time for decompressing the streams as well
        ostream = CountedNullStream()
        pdb = PackedDB(os.path.join(self.gitrepopath, "objects/pack"))

        ni = 1000
        count = 0
        st = time()
>       for sha in pdb.sha_iter():

gitdb/test/performance/test_pack_streaming.py:47:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
gitdb/db/pack.py:106: in sha_iter
    for entity in self.entities():
gitdb/db/pack.py:179: in entities
    return [item[1] for item in self._entities]
gitdb/util.py:253: in __getattr__
    self._set_cache_(attr)
gitdb/db/pack.py:54: in _set_cache_
    self.update_cache(force=True)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <gitdb.db.pack.PackedDB object at 0x7fe18cd14a60>, force = True

    def update_cache(self, force=False):
        """
        Update our cache with the acutally existing packs on disk. Add new ones,
        and remove deleted ones. We keep the unchanged ones

        :param force: If True, the cache will be updated even though the directory
            does not appear to have changed according to its modification timestamp.
        :return: True if the packs have been updated so there is new information,
            False if there was no change to the pack database"""
>       stat = os.stat(self.root_path())
E       FileNotFoundError: [Errno 2] No such file or directory: '/home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/.git/objects/pack'

gitdb/db/pack.py:141: FileNotFoundError
_____________________________________________________________ TestPackStreamingPerformance.test_stream_reading _____________________________________________________________

self = <gitdb.test.performance.test_pack_streaming.TestPackStreamingPerformance testMethod=test_stream_reading>

    @skip_on_travis_ci
    def test_stream_reading(self):
        # raise SkipTest()
        pdb = PackedDB(os.path.join(self.gitrepopath, "objects/pack"))

        # streaming only, meant for --with-profile runs
        ni = 5000
        count = 0
        pdb_stream = pdb.stream
        total_size = 0
        st = time()
>       for sha in pdb.sha_iter():

gitdb/test/performance/test_pack_streaming.py:75:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
gitdb/db/pack.py:106: in sha_iter
    for entity in self.entities():
gitdb/db/pack.py:179: in entities
    return [item[1] for item in self._entities]
gitdb/util.py:253: in __getattr__
    self._set_cache_(attr)
gitdb/db/pack.py:54: in _set_cache_
    self.update_cache(force=True)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <gitdb.db.pack.PackedDB object at 0x7fe18cc02a30>, force = True

    def update_cache(self, force=False):
        """
        Update our cache with the acutally existing packs on disk. Add new ones,
        and remove deleted ones. We keep the unchanged ones

        :param force: If True, the cache will be updated even though the directory
            does not appear to have changed according to its modification timestamp.
        :return: True if the packs have been updated so there is new information,
            False if there was no change to the pack database"""
>       stat = os.stat(self.root_path())
E       FileNotFoundError: [Errno 2] No such file or directory: '/home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/.git/objects/pack'

gitdb/db/pack.py:141: FileNotFoundError
============================================================================= warnings summary =============================================================================
gitdb/test/test_pack.py::TestPack::test_pack_index
gitdb/test/test_pack.py::TestPack::test_pack_index
  /home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/gitdb/test/test_pack.py:76: DeprecationWarning: Please use assertRaises instead.
    self.failUnlessRaises(ValueError, index.partial_sha_to_index, "\0", 2)

gitdb/test/test_stream.py::TestStream::test_compressed_writer
gitdb/test/test_stream.py::TestStream::test_compressed_writer
gitdb/test/test_stream.py::TestStream::test_compressed_writer
  /home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/gitdb/test/test_stream.py:138: DeprecationWarning: Please use assertRaises instead.
    self.failUnlessRaises(OSError, os.close, fd)

gitdb/test/test_util.py::TestUtils::test_lockedfd
  /home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/gitdb/test/test_util.py:43: DeprecationWarning: Please use assertRaises instead.
    self.failUnlessRaises(AssertionError, lfd.rollback)

gitdb/test/test_util.py::TestUtils::test_lockedfd
  /home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/gitdb/test/test_util.py:44: DeprecationWarning: Please use assertRaises instead.
    self.failUnlessRaises(AssertionError, lfd.commit)

gitdb/test/test_util.py::TestUtils::test_lockedfd
  /home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/gitdb/test/test_util.py:80: DeprecationWarning: Please use assertRaises instead.
    self.failUnlessRaises(IOError, olfd.open)

gitdb/test/db/test_git.py::TestGitDB::test_writing
gitdb/test/db/test_loose.py::TestLooseDB::test_basics
  /home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/gitdb/test/db/lib.py:105: DeprecationWarning: Please use assertRaises instead.
    self.failUnlessRaises(BadObject, db.info, sha)

gitdb/test/db/test_git.py::TestGitDB::test_writing
gitdb/test/db/test_loose.py::TestLooseDB::test_basics
  /home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/gitdb/test/db/lib.py:106: DeprecationWarning: Please use assertRaises instead.
    self.failUnlessRaises(BadObject, db.stream, sha)

gitdb/test/db/test_loose.py::TestLooseDB::test_basics
  /home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/gitdb/test/db/test_loose.py:35: DeprecationWarning: Please use assertRaises instead.
    self.failUnlessRaises(BadObject, ldb.partial_to_complete_sha_hex, '0000')

gitdb/test/db/test_pack.py::TestPackDB::test_writing
  /home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/gitdb/test/db/test_pack.py:87: DeprecationWarning: Please use assertRaises instead.
    self.failUnlessRaises(BadObject, pdb.partial_to_complete_sha, b'\0\0', 4)

-- Docs: https://docs.pytest.org/en/stable/warnings.html
========================================================================= short test summary info ==========================================================================
SKIPPED [1] gitdb/test/test_pack.py:246: Skipped
FAILED gitdb/test/test_example.py::TestExamples::test_base - FileNotFoundError: [Errno 2] No such file or directory: '/home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/.git/obje...
FAILED gitdb/test/db/test_git.py::TestGitDB::test_reading - gitdb.exc.InvalidDBRoot: /home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/.git/objects
FAILED gitdb/test/db/test_ref.py::TestReferenceDB::test_writing - AssertionError: assert 0 == 1
FAILED gitdb/test/performance/test_pack.py::TestPackedDBPerformance::test_correctness - FileNotFoundError: [Errno 2] No such file or directory: '/home/tkloczko/rpmbuild/...
FAILED gitdb/test/performance/test_pack.py::TestPackedDBPerformance::test_loose_correctness - gitdb.exc.InvalidDBRoot: /home/tkloczko/rpmbuild/BUILD/gitdb-4.0.7/.git/obj...
FAILED gitdb/test/performance/test_pack.py::TestPackedDBPerformance::test_pack_random_access - FileNotFoundError: [Errno 2] No such file or directory: '/home/tkloczko/rp...
FAILED gitdb/test/performance/test_pack_streaming.py::TestPackStreamingPerformance::test_pack_writing - FileNotFoundError: [Errno 2] No such file or directory: '/home/tk...
FAILED gitdb/test/performance/test_pack_streaming.py::TestPackStreamingPerformance::test_stream_reading - FileNotFoundError: [Errno 2] No such file or directory: '/home/...
========================================================== 8 failed, 15 passed, 1 skipped, 14 warnings in 22.85s ===========================================================
Byron commented 3 years ago

Since the CI system runs the test suite without issues it seems to be no general issue.

Please note that the test suite depends on its own repository clone, so extracted archives won't work. Instead one would clone the repository, checkout the respective tag, and go from there.

kloczek commented 3 years ago

Did you ever look on the error messages?

Byron commented 3 years ago

I can reproduce some failing tests locally on MacOS on a checkout that is actually a submodule. As long as CI works I am happily ignoring this as gitdb is in maintenance mode.

If you can figure out why this happens and submit a PR, this would of course be very welcome.

Reopening as it is easy to reproduce.

kloczek commented 3 years ago

Please let me know if you will have some fixes (even partial). I would be glad to help. Thank you :)