testing bzr under Wine
Martin Pool
mbp at canonical.com
Sun Aug 16 02:33:48 BST 2009
2009/8/15 John Arbash Meinel <john at arbash-meinel.com>:
>>> 3) Is a read lock exclusive with a write lock inside the same process?
>>
>> I'm not sure how to quickly test this. I would guess yes.
>
> l1 = bzrlib.ReadLock('filename')
> l2 = bzrlib.WriteLock('filename')
>
> If it does its own locking it should fail. If it thunks to fcntl
> locking, then it won't.
It does in fact fail:
>>> l1 = lock.ReadLock('fo')
>>> l2 = lock.WriteLock('fo')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "bzrlib\lock.py", line 498, in __init__
"rb+")
File "bzrlib\lock.py", line 459, in _open
raise errors.LockContention(filename, e)
bzrlib.errors.LockContention: Could not acquire lock "fo": [Error 32]
Sharing violation
So overall it looks like this will give us good but not perfect
coverage; when some of the 2a stuff is settled I might do a pass
through selftest in this interpreter. There are quite a few failures.
--
Martin <http://launchpad.net/~mbp/>
More information about the bazaar
mailing list