[RFC] Summary on test suite failures on OSX

Vincent Ladeuil v.ladeuil+lp at free.fr
Thu Sep 4 17:55:26 BST 2008


Below are the tests that are erroring or failing on OSX as of
today. I also include the expected failures specific to OSX.

,----
| ERROR: blackbox.test_export.TestExport.test_tar_export
|     'NoneType' object has no attribute 'startswith'
`----

Not totally diagnosed yet. But the traceback ends up in
python2.5/tarfile.py and there are a *lot* of differences between
the stock OSX 10.4 python-2.5.1 and python-2.5.2 on hardy.

I think Guillermo uses OSX 10.5, he may tell us if it's failing
there too.

,----
| ERROR: blackbox.test_init.TestInit.test_init_unicode
|     'ascii' codec can't encode character u'\xb5' in position 18: ordinal not in range(128)
`----

Running with LC_CTYPE=en_US.UTF-8 and LC_ALL=en_US.UTF-8 makes it
pass, what should we do here ?

That seems to be linked to osutils.get_user_encoding() try to
work around some bug on darwin:

    if sys.platform == 'darwin':
        # work around egregious python 2.4 bug
        sys.platform = 'posix'
        try:
            import locale
        finally:
            sys.platform = 'darwin'
    else:
        import locale

I'd love some info about that egregious bug :-/

Currently, running python /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/locale.py
barfs with the very unhelpful:
Locale aliasing:

Locale defaults as determined by getdefaultlocale():
------------------------------------------------------------------------
Language:  (undefined)
Encoding:  mac-roman

Locale settings on startup:
------------------------------------------------------------------------
LC_NUMERIC ...
   Language:  (undefined)
   Encoding:  (undefined)

LC_MESSAGES ...
   Language:  (undefined)
   Encoding:  (undefined)

LC_MONETARY ...
   Language:  (undefined)
   Encoding:  (undefined)

LC_COLLATE ...
   Language:  (undefined)
   Encoding:  (undefined)

LC_CTYPE ...
   Language:  (undefined)
   Encoding:  (undefined)

LC_TIME ...
   Language:  (undefined)
   Encoding:  (undefined)


Locale settings after calling resetlocale():
------------------------------------------------------------------------
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/locale.py", line 1558, in <module>
    _print_locale()
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/locale.py", line 1521, in _print_locale
    resetlocale()
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/locale.py", line 486, in resetlocale
    _setlocale(category, _build_localename(getdefaultlocale()))
locale.Error: unsupported locale setting

,----
| XFAIL: test_bundle.V08BundleTester.test_unicode_bundle
| Mac OSX doesn't preserve unicode combining characters.
| 
| XFAIL: test_bundle.V09BundleKnit1Tester.test_unicode_bundle
| Mac OSX doesn't preserve unicode combining characters.
| 
| XFAIL: test_bundle.V09BundleKnit2Tester.test_unicode_bundle
| Mac OSX doesn't preserve unicode combining characters.
| 
| XFAIL: test_bundle.V4BundleTester.test_unicode_bundle
| Mac OSX doesn't preserve unicode combining characters.
`----

This ones will be there for a long time.

,----
| XFAIL: test_bundle.V4WeaveBundleTester.test_unicode_bundle
| Bug #141438: fails for WorkingTree3 on OSX
`----

Waiting for WorkingTree3 to be deprecated :)

,----
| FAIL: test_transform.TestTreeTransform.test_case_insensitive_clash
|     FileExists not raised
`----

Aaron gave feedback, fix in progress.

,----
| ERROR: tree_implementations.test_test_trees.TestTreeShapes.test_tree_with_merged_utf8(WorkingTreeFormat4)
|     Working tree "/private/tmp/testbzr-vJk5hc.tmp/bzrlib.tests.tree_implementations.test_test_trees.TestTreeShapes.test_tree_with_merged_utf8(WorkingTreeFormat4)/work/" has uncommitted changes.
| 
| ERROR: tree_implementations.test_test_trees.TestTreeShapes.test_tree_with_merged_utf8(RevisionTree)
|     Working tree "/private/tmp/testbzr-vJk5hc.tmp/bzrlib.tests.tree_implementations.test_test_trees.TestTreeShapes.test_tree_with_merged_utf8(RevisionTree)/work/" has uncommitted changes.
| 
| ERROR: tree_implementations.test_test_trees.TestTreeShapes.test_tree_with_merged_utf8(DirStateRevisionTree)
|     Working tree "/private/tmp/testbzr-vJk5hc.tmp/bzrlib.tests.tree_implementations.test_test_trees.TestTreeShapes.test_tree_with_merged_utf8(DirStateRevisionTree)/work/" has uncommitted changes.
| 
| ERROR: tree_implementations.test_test_trees.TestTreeShapes.test_tree_with_merged_utf8(PreviewTree)
|     Working tree "/private/tmp/testbzr-vJk5hc.tmp/bzrlib.tests.tree_implementations.test_test_trees.TestTreeShapes.test_tree_with_merged_utf8(PreviewTree)/work/" has uncommitted changes.
| 
| ERROR: tree_implementations.test_test_trees.TestTreeShapes.test_tree_with_merged_utf8(PreviewTreePost)
|     Working tree "/private/tmp/testbzr-vJk5hc.tmp/bzrlib.tests.tree_implementations.test_test_trees.TestTreeShapes.test_tree_with_merged_utf8(PreviewTreePost)/work/" has uncommitted changes.
`----

These ones are weird, painfully tracking *when* the problem
appeared and how it evolved by running:

  ./bzr selftest bzrlib.tests.tree_implementations.test_test_trees.TestTreeShapes.test_tree_with_merged_utf8 --no-plugins -v

I got:

bzr at 2298: 0/3 failures

bzr at 2322: 2/5 failures (WorkingTreeFormat4, DirStateRevisionTree)
,----
| revno: 2322
| committer: Canonical.com Patch Queue Manager<pqm at pqm.ubuntu.com>
| branch nick: +trunk
| timestamp: Wed 2007-03-07 10:45:44 +0000
| message:
|   (robertc) Merge dirstate and subtrees. (Robert Collins, Martin Pool, Aaaron Bentley, John A Meinel, James Westby)
`----

Yeah, right, go find the bug in a ~20.000 lines patch 8-(

bzr at 2321.1.1: 2/5 failures (WorkingTreeFormat4, DirStateRevisionTree)

Well, let's go back to trunk to find the 2/5 5/7 differences.

bzr at 3386: 2/5 failures (WorkingTreeFormat4, DirStateRevisionTree)
bzr at 3387: 2/6 failures (WorkingTreeFormat4, DirStateRevisionTree)

Adding PreviewTree ok.

bzr at 3506: 2/6 failures (WorkingTreeFormat4, DirStateRevisionTree)
bzr at 3507: 4/6 failures (WorkingTreeFormat4, RevisionTree,
                        DirStateRevisionTree, PreviewTree)

Side-effect of test coverage improvement. PreviewTree failing :-/

bzr at 3662: 4/6 failures (WorkingTreeFormat4, RevisionTree,
                        DirStateRevisionTree, PreviewTree)
bzr at 3663: 5/7 failures (WorkingTreeFormat4, RevisionTree,
                        DirStateRevisionTree, PreviewTree, PreviewTreePost)

More tests, probably same root cause.


bzr at 3671: 5/7 failures (WorkingTreeFormat4, RevisionTree,
                        DirStateRevisionTree, PreviewTree, PreviewTreePost)

Actual state.

So these ones are very old.

Anyway, stepping with pdb on Linux until:
bzrlib/delta.py(252)_compare_trees()

The preceding iter_changes returns without yielding anything and:

p new_tree
<WorkingTree4 of /tmp/testbzr-lUijvO.tmp/bzrlib.tests.tree_implementations.test_test_trees.TestTreeShapes.test_tree_with_merged_utf8(WorkingTreeFormat4)/work>
(Pdb) import os
(Pdb) p os.listdir('/tmp/testbzr-lUijvO.tmp/bzrlib.tests.tree_implementations.test_test_trees.TestTreeShapes.test_tree_with_merged_utf8(WorkingTreeFormat4)/work')
['.bzr', 'f\xc3\xb6', 'b\xc3\xa5r', 'tree2']
(Pdb) p os.listdir('/tmp/testbzr-lUijvO.tmp/bzrlib.tests.tree_implementations.test_test_trees.TestTreeShapes.test_tree_with_merged_utf8(WorkingTreeFormat4)/work/tree2')
['.bzr', 'b\xc3\xa5r', 'f\xc3\xb6']
(Pdb) 


whereas on OSX, changes are detected.

(Pdb) p new_tree
<WorkingTree4 of /private/tmp/testbzr-Ebb-DR.tmp/bzrlib.tests.tree_implementations.test_test_trees.TestTreeShapes.test_tree_with_merged_utf8(WorkingTreeFormat4)/work>
(Pdb) import os
(Pdb) p os.listdir('/private/tmp/testbzr-Ebb-DR.tmp/bzrlib.tests.tree_implementations.test_test_trees.TestTreeShapes.test_tree_with_merged_utf8(WorkingTreeFormat4)/work')
['.bzr', 'ba\xcc\x8ar', 'fo\xcc\x88', 'tree2']
(Pdb) p os.listdir('/private/tmp/testbzr-Ebb-DR.tmp/bzrlib.tests.tree_implementations.test_test_trees.TestTreeShapes.test_tree_with_merged_utf8(WorkingTreeFormat4)/work/tree2')
['.bzr', 'ba\xcc\x8ar', 'fo\xcc\x88']
(Pdb) 

And since the test does:

        self.build_tree([u'tree2/b\xe5r/z\xf7z'])
        tree2.add([u'b\xe5r/z\xf7z'], [u'z\xf7z-id'.encode('utf-8')])
        tree2.commit(u'to m\xe9rge', rev_id=u'r\xe9v-2'.encode('utf8'))

It should be a normalization problem.

I've yet to understand if the problem is in how the test is
written of if dirstate lacks some normalization.

Comments welcome while the investigations continue...

,----
| FAIL: workingtree_implementations.test_rename_one.TestRenameOne.test_rename_to_denormalised_fails(WorkingTreeFormat4)
|     (<class 'bzrlib.errors.InvalidNormalization'>, <type 'exceptions.UnicodeEncodeError'>) not raised
| 
| FAIL: workingtree_implementations.test_rename_one.TestRenameOne.test_rename_to_denormalised_fails(WorkingTreeFormat3)
|     (<class 'bzrlib.errors.InvalidNormalization'>, <type 'exceptions.UnicodeEncodeError'>) not raised
| 
| FAIL: workingtree_implementations.test_rename_one.TestRenameOne.test_rename_to_denormalised_fails(WorkingTreeFormat2)
|     (<class 'bzrlib.errors.InvalidNormalization'>, <type 'exceptions.UnicodeEncodeError'>) not raised
| 
`----

These ones fail since they have been introduced (bzr at 2843),
Robert, can you explain the intent of this test ? Or better its
consequences.

I can add a:
  if osutils.normalizes_filenames():
     from bzrlib import tests
     raise tests.TestNotApplicable('OSX normalizes filenames')

But is this correct ? If it's to guard against invalid filenames
on the file system, AFAIK, OSX provides that.

,----
| ERROR: workingtree_implementations.test_workingtree.TestIllegalPaths.test_bad_fs_path(WorkingTreeFormat4)
|     invalid mode: wb
| 
| ERROR: workingtree_implementations.test_workingtree.TestIllegalPaths.test_bad_fs_path(WorkingTreeFormat3)
|     invalid mode: wb
| 
| ERROR: workingtree_implementations.test_workingtree.TestIllegalPaths.test_bad_fs_path(WorkingTreeFormat2)
|     invalid mode: wb
| 
`----

The same should apply here, I think :)

Thanks in advance,

   Vincent



More information about the bazaar mailing list