bt.test_lockdir.TestLockDir.test_break_lock_corrupt_info fails on windows

Bug #659978 reported by Martin Packman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Low
John A Meinel

Bug Description

One of the tests added for the fix to bug 619872 relies on the unix locking semantics and therefore doesn't work on windows. This may just be a test problem, or might indicate a deeper problem with expectation that LockDir.break_lock will work when there's a live lock instance around still.

Traceback (most recent call last):
  File ".\bzrlib\tests\test_lockdir.py", line 586, in test_break_lock_corrupt_info
    ld2.break_lock()
  File ".\bzrlib\lockdir.py", line 359, in break_lock
    self.force_break_corrupt(e.file_data)
  File ".\bzrlib\lockdir.py", line 437, in force_break_corrupt
    self.transport.delete(broken_info_path)
  File ".\bzrlib\transport\local.py", line 434, in delete
    self._translate_error(e, path)
  File ".\bzrlib\transport\__init__.py", line 316, in _translate_error
    raise errors.PermissionDenied(path, extra=e)
PermissionDenied: Permission denied: "%TMP%/testbzr-lxrfao.tmp/r.test_break_lock_corrupt_info/work/test_lock/broken.r03360b5kkik1mzf1n4b.tmp/info": [Errno 13] Permission denied: u'%TMP%/testbzr-lxrfao.tmp/r.test_break_lock_corrupt_info/work/test_lock/broken.r03360b5kkik1mzf1n4b.tmp/info'

This can also been seen on babune (with a little bug 273978 confusion added):
<http://babune.ladeuil.net:24842/job/selftest-windows/195/testReport/bzrlib.tests.test_lockdir/TestLockDir/test_break_lock_corrupt_info/>

The merge proposal that added the test is:
<https://code.launchpad.net/~spiv/bzr/graceful-broken-lockdir-619872-2.0/+merge/34657>

Tags: win32

Related branches

Martin Packman (gz)
Changed in bzr:
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
John A Meinel (jameinel) wrote :

We have some other tests like this that just use a Feature check to skip on Windows.

Revision history for this message
Martin Packman (gz) wrote :

That would be a remedial option, but windows does want to test that "break_lock works even if the info file is corrupt" so fixing would be better than skipping.

Revision history for this message
Martin Pool (mbp) wrote : Re: [Bug 659978] Re: bt.test_lockdir.TestLockDir.test_break_lock_corrupt_info fails on windows

It shouldn't be necessary to skip this test. I guess it's failing
because we're trying to delete the info file while a handle is still
open. We should just close the file.

Revision history for this message
John A Meinel (jameinel) wrote :

It has to be closed in order to rename the directory, so I'm not really sure why it would be open. (Maybe the code that re-reads the info file to make sure we got the lock?)

John A Meinel (jameinel)
Changed in bzr:
assignee: nobody → John A Meinel (jameinel)
milestone: none → 2.3b5
status: Confirmed → In Progress
Vincent Ladeuil (vila)
Changed in bzr:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.