~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_repository.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-05-27 01:32:30 UTC
  • mfrom: (3446.2.2 nfs-failure)
  • Revision ID: pqm@pqm.ubuntu.com-20080527013230-8qjaju10duxpy3e2
(mbp) Just warn about errors deleting obsolete packs

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
from bzrlib.tests import (
40
40
    TestCase,
41
41
    TestCaseWithTransport,
 
42
    TestSkipped,
42
43
    test_knit,
43
44
    )
44
 
from bzrlib.transport import get_transport
 
45
from bzrlib.transport import (
 
46
    fakenfs,
 
47
    get_transport,
 
48
    )
45
49
from bzrlib.transport.memory import MemoryServer
46
50
from bzrlib.util import bencode
47
51
from bzrlib import (
946
950
        pack_names = [node[1][0] for node in index.iter_all_entries()]
947
951
        self.assertTrue(large_pack_name in pack_names)
948
952
 
 
953
    def test_fail_obsolete_deletion(self):
 
954
        # failing to delete obsolete packs is not fatal
 
955
        format = self.get_format()
 
956
        server = fakenfs.FakeNFSServer()
 
957
        server.setUp()
 
958
        self.addCleanup(server.tearDown)
 
959
        transport = get_transport(server.get_url())
 
960
        bzrdir = self.get_format().initialize_on_transport(transport)
 
961
        repo = bzrdir.create_repository()
 
962
        repo_transport = bzrdir.get_repository_transport(None)
 
963
        self.assertTrue(repo_transport.has('obsolete_packs'))
 
964
        # these files are in use by another client and typically can't be deleted
 
965
        repo_transport.put_bytes('obsolete_packs/.nfsblahblah', 'contents')
 
966
        repo._pack_collection._clear_obsolete_packs()
 
967
        self.assertTrue(repo_transport.has('obsolete_packs/.nfsblahblah'))
 
968
 
949
969
    def test_pack_after_two_commits_packs_everything(self):
950
970
        format = self.get_format()
951
971
        tree = self.make_branch_and_tree('.', format=format)