win32: selftest result after merge John win32 fixes

John Arbash Meinel john at arbash-meinel.com
Wed Jul 5 14:35:15 BST 2006


Alexander Belchenko wrote:
> Alexander Belchenko пишет:
>> It's very strange for me, but after merging John's work into mainline
>> amount of failed tests increased (was 19, now 27). And during selftest
>> there is error message on the screen:
>>
>> running tests...
>> bzr: ERROR: [Errno 13] Permission denied:
>> u'E:/work/MyCode/bzr/devel/bzr.dev/test0000.tmp\\_reconcile.TestsNeedingReweave
>>
>> ..test_reweave_inventory_without_revision_reconciler(RepositoryFormat7)'
>>
>> And again testXXXX.tmp directory won't delete after selftest.
> 
> False alarm. This is because of too long path names in tests (exceed 255
> characters). When I run selftest in shortest possible directory (e.g.
> E:\bzrtest) then it pass.
> 
> Probably for standalone bzr.exe that installed by default into
> "C:\Program Files\Bazaar-NG" this limitation also will cause some tests
> to fail.
> 
> Aaron, what you think, can we shorten test directories again a bit? I
> remember you provide cut to 100 characters. May be it safely could cut
> to 70-80 characters?
> 
> -- 
> Alexander

Well, there is always some level where it would fail.
The specific line in question is 928 of bzrlib/tests/__init__.py

The included patch changes it to be only 50 characters.

I'm surprised we're running out of characters. You're only using about
30 in your path. I would have thought we would have more working room
than that.

I guess a revision id for us is typically 50 chars long, and file-ids
vary a bit more, but are around 55 chars as well.

Right now, 'gen_file_id()' generates an id which is always ~34
characters longer than the original filename. (14 timestamp, 16 random
chars, 1-2 serial number)

And then if you have weird characters it adds a few more because of
escaping. The other part of the patch changes how gen_file_id works, so
that we don't create unboundedly long file ids. We'll still create long
ones when converting from other SCMs, but at least we'll play nicer
ourselves.

Can you try each one individually, and see if they both help?

John
=:->



=== modified file 'bzrlib/tests/__init__.py'
--- bzrlib/tests/__init__.py    2006-06-30 15:13:19 +0000
+++ bzrlib/tests/__init__.py    2006-07-05 13:25:12 +0000
@@ -925,7 +925,7 @@
         _currentdir = os.getcwdu()
         # shorten the name, to avoid test failures due to path length
         short_id = self.id().replace('bzrlib.tests.', '') \
-                   .replace('__main__.', '')[-100:]
+                   .replace('__main__.', '')[-50:]
         # it's possible the same test class is run several times for
         # parameterized tests, so make sure the names don't collide.
         i = 0

 def gen_root_id():
=== modified file 'bzrlib/workingtree.py'
--- bzrlib/workingtree.py       2006-07-03 04:59:44 +0000
+++ bzrlib/workingtree.py       2006-07-05 13:34:45 +0000
@@ -144,7 +144,7 @@
     # XXX TODO: truncate the filename to something like 20 or 30 chars.
     # XXX TODO: consider what to do with ids that look like illegal
filepaths
     # on platforms we support.
-    return _gen_file_id_re.sub('', name) + _next_id_suffix()
+    return _gen_file_id_re.sub('', name).lower()[:20] + _next_id_suffix()


 def gen_root_id():


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060705/959c83a9/attachment.pgp 


More information about the bazaar mailing list