cdv test failures

John Arbash Meinel john at arbash-meinel.com
Thu May 25 00:33:16 BST 2006


Robert Collins wrote:
> I see cdv failures on about 50% of my test runs. Here is a sample:
> 
> ======================================================================
> FAIL: test_multiple_ranges (bzrlib.tests.test_diff.TestCDVDiffLib)
> 
> vvvv[log from
> bzrlib.tests.test_diff.TestCDVDiffLib.test_multiple_ranges]-----
> 
> ^^^^[log from
> bzrlib.tests.test_diff.TestCDVDiffLib.test_multiple_ranges]-----
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "/home/robertc/source/baz/integration/bzrlib/tests/test_diff.py",
> line 221, in test_multiple_ranges
>     , [(0, 0, 3), (6, 4, 3), (9, 20, 7)])
>   File "/home/robertc/source/baz/integration/bzrlib/tests/test_diff.py",
> line 217, in chk_blocks
>     self.assertEquals(matching, blocks)
> AssertionError: [(0, 0, 3), (6, 4, 3), (9, 20, 7)] != [(0, 0, 3), (6, 4,
> 2), (8, 19, 8)]

Are you saying that you get intermittent failures? As in sometimes this
succeeds and sometimes it fails?

I would have thought SequenceMatcher was deterministic, but it does use
a dictionary. So if it is possible that keys don't stay sorted in the
same order, I suppose it could return different results.

In this specific case, both results are valid, because a letter is
repeated. We have:
abcdefgh i jklmnop

versus
abcXgh i YZQRSTUVWXYZ i jklmnop

I added the spaces to make it clear.

basically, the i could be associated early or late. If you want to
remove the ambiguity, you could remove the last 'i' in the second
string, and then change the match to
[(0, 0, 3), (6, 4, 3), (9, 19, 7)]

> Cheers,
> Rob
> 

That is the first I've heard of dictionaries not being deterministic. I
know they are random, but I've never heard of them sorting in a
different order.

John
=:->

-------------- 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/20060524/23529530/attachment.pgp 


More information about the bazaar mailing list