windows selftest rev 1372
John A Meinel
john at arbash-meinel.com
Fri Oct 28 21:45:46 BST 2005
Alexey Shamrin wrote:
> On 28/10/05, Alexey Shamrin <shamrin at gmail.com> wrote:
>> Unfortunately, I abandoned the idea of setting *automatic* regression
>> testing under windows. Mostly because of currently hanging tests (but
>> there are other reasons).
>
> Sorry, I wanted to say that the tests were hanging before, not now.
They aren't hanging for you? Interesting, because they are for me.
Basically what is failing is this code in blackbox.py:
os.mkdir('a')
os.chdir('a')
self.example_branch()
self.runbzr('pull', retcode=1)
self.runbzr('missing', retcode=1)
self.runbzr('missing .')
self.runbzr('missing')
self.runbzr('pull') <--- hangs here
self.runbzr('pull /', retcode=1)
self.runbzr('pull')
Basically, 'pull' instantiates 2 branches. One that it is going to pull
from, and one that it will push into. It has to open the former for
reading, and the latter for writing.
In this specific case, the from and to are the same branch. So it is
locking the same file twice. Here is the DEBUG output:
run bzr: pull
got branch format u'Bazaar-NG branch, format 6\n'
trying to open u'.' with transport
<bzrlib.transport.local.LocalTransport object at 0xe7ecac>
got branch format u'Bazaar-NG branch, format 6\n'
lock read:
_Branch(u'/cygdrive/h/dev/bzr/bzr-win32/test0003.tmp/blackbox.TestCommands.test_pull/a')
(None)
unlock:
_Branch(u'/cygdrive/h/dev/bzr/bzr-win32/test0003.tmp/blackbox.TestCommands.test_pull/a')
(1)
lock write:
_Branch(u'/cygdrive/h/dev/bzr/bzr-win32/test0003.tmp/blackbox.TestCommands.test_pull/a')
(None)
lock read:
_Branch(u'/cygdrive/h/dev/bzr/bzr-win32/test0003.tmp/blackbox.TestCommands.test_pull/a')
(None)
In my understanding, under windows when a single process asks for a
second lock, it will actually block, waiting for the earlier lock to be
released.
Now, in our Win32 changes from Alexander, any lock that actually blocks
will raise an exception, rather than hanging.
Under cygwin (where I am testing for right now), it does not perform
this trickery, and does block.
It seems that on Linux, asking for a shared lock, when you already have
an exclusive one, is a no-op. But this is not true on Windows.
I think we need to go back to what Aaron Bentley recommended, and turn
our locks into singletons. We can then decide if we would rather "bzr
pull ." succeeds or throws a multi-lock exception.
John
=:->
>
> --
> Alexey
>
>
-------------- 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/20051028/d093d5c7/attachment.pgp
More information about the bazaar
mailing list