[bug] bzr.dev fails test suite on Mac OS X

John A Meinel john at arbash-meinel.com
Tue Feb 21 17:08:23 GMT 2006


I just tried merging the latest bzr.dev, and it turns out that the test
suite fails in the new Transform code. The traceback is very long, but
basically the failing tests are:

bzrlib.tests.test_merge_core.FunctionalMergeTest.test_merge_rename_to_temp_before_delete
Traceback (most recent call last):
  File
"/Users/jameinel/dev/bzr/bzr-jam-integration/bzrlib/tests/test_merge_core.py",
line 578, in test_merge_rename_to_temp_before_delete
    merge(['b', -1],['b', 1],this_dir='a')
  File "/Users/jameinel/dev/bzr/bzr-jam-integration/bzrlib/builtins.py",
line 2214, in merge
    conflicts = merger.do_merge()
  File "/Users/jameinel/dev/bzr/bzr-jam-integration/bzrlib/merge.py",
line 238, in do_merge
    merge = self.merge_type(**kwargs)
  File "/Users/jameinel/dev/bzr/bzr-jam-integration/bzrlib/merge.py",
line 340, in __init__
    self.tt.apply()
  File
"/Users/jameinel/dev/bzr/bzr-jam-integration/bzrlib/transform.py", line
660, in apply
    self._apply_removals(inv, limbo_inv)
  File
"/Users/jameinel/dev/bzr/bzr-jam-integration/bzrlib/transform.py", line
682, in _apply_removals
    self.delete_any(full_path)
  File
"/Users/jameinel/dev/bzr/bzr-jam-integration/bzrlib/transform.py", line
284, in delete_any
    os.unlink(full_path)
OSError: [Errno 1] Operation not permitted:
'/Users/jameinel/dev/bzr/bzr-jam-integration/test0001.tmp/test_merge_core.FunctionalMergeTest.test_merge_rename_to_temp_before_delete/a/foo'

^^^^[log from
bzrlib.tests.test_transform.TestTreeTransform.test_name_invariants]
----------------------------------------------------------------------
Traceback (most recent call last):
  File
"/Users/jameinel/dev/bzr/bzr-jam-integration/bzrlib/tests/test_transform.py",
line 239, in test_name_invariants
    mangle_tree.apply()
  File
"/Users/jameinel/dev/bzr/bzr-jam-integration/bzrlib/transform.py", line
660, in apply
    self._apply_removals(inv, limbo_inv)
  File
"/Users/jameinel/dev/bzr/bzr-jam-integration/bzrlib/transform.py", line
682, in _apply_removals
    self.delete_any(full_path)
  File
"/Users/jameinel/dev/bzr/bzr-jam-integration/bzrlib/transform.py", line
284, in delete_any
    os.unlink(full_path)
OSError: [Errno 1] Operation not permitted:
'/Users/jameinel/dev/bzr/bzr-jam-integration/test0001.tmp/test_transform.TestTreeTransform.test_name_invariants/dying_directory'

Also, when the test_name_invariants exits, I'm getting a 'file was not
explicitly unlocked'. So someone is taking out a lock, without putting
it in a try/finally block.

As near as I can tell, the problem is that os.unlink doesn't return
errno.EISDIR, it is returning errno.EPERM

Is it okay if we just add EPERM to the caught errors?

This patch makes the tests pass.

=== modified file 'bzrlib/transform.py'
--- bzrlib/transform.py
+++ bzrlib/transform.py
@@ -284,7 +284,7 @@
             os.unlink(full_path)
         except OSError, e:
         # We may be renaming a dangling inventory id
-            if e.errno != errno.EISDIR and e.errno != errno.EACCES:
+            if e.errno not in (errno.EISDIR, errno.EACCES, errno.EPERM):
                 raise
             os.rmdir(full_path)

John
=:->


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060221/024604c7/attachment.pgp 


More information about the bazaar mailing list