Merge lp:~lifeless/bzr/loomsupport into lp:bzr

Proposed by Robert Collins
Status: Merged
Approved by: Robert Collins
Approved revision: no longer in the source branch.
Merged at revision: 5318
Proposed branch: lp:~lifeless/bzr/loomsupport
Merge into: lp:bzr
Diff against target: 34 lines (+13/-4)
1 file modified
bzrlib/tests/per_interbranch/test_push.py (+13/-4)
To merge this branch: bzr merge lp:~lifeless/bzr/loomsupport
Reviewer Review Type Date Requested Status
Vincent Ladeuil Approve
Review via email: mp+28375@code.launchpad.net

Commit message

Make the interbranch test_no_get_parent_map_after_insert_stream test work for looms.

Description of the change

test_no_get_parent_map_after_insert_stream is overly sensitive, this
loosens it a little for looms.

To post a comment you must log in.
Revision history for this message
Vincent Ladeuil (vila) wrote :

As said on IRC mentioning loom in core feels dirty, but the commit messageS are good enough to tell
the next maintainer what the problem is about.

review: Approve
Revision history for this message
John Szakmeister (jszakmeister) wrote :

On Thu, Jun 24, 2010 at 4:32 AM, Robert Collins
<email address hidden> wrote:
[snip]
> === modified file 'bzrlib/tests/per_interbranch/test_push.py'
> --- bzrlib/tests/per_interbranch/test_push.py   2010-06-17 06:30:22 +0000
> +++ bzrlib/tests/per_interbranch/test_push.py   2010-06-24 08:32:39 +0000
> @@ -19,6 +19,11 @@
>  from cStringIO import StringIO
>  import os
>
> +from testtools.matchers import (
> +    Equals,
> +    MatchesAny,
> +    )
> +
>  from bzrlib import (
>     branch,
>     builtins,
> @@ -272,10 +277,14 @@
>         calls_after_insert_stream = hpss_call_names[insert_stream_idx:]
>         # After inserting the stream the client has no reason to query the
>         # remote graph any further.
> -        self.assertEqual(
> -            ['Repository.insert_stream_1.19', 'Repository.insert_stream_1.19',
> -             'get', 'Branch.set_last_revision_info', 'Branch.unlock'],
> -            calls_after_insert_stream)
> +        bzr_core_trace = Equals(
> +            ['Repository.insert_stream_1.19', 'Repository.insert_stream_1.19',
> +             'get', 'Branch.set_last_revision_info', 'Branch.unlock'])
> +        bzr_loom_trace = Equals(
> +            ['Repository.insert_stream_1.19', 'Repository.insert_stream_1.19',
> +             'get', 'Branch.set_last_revision_info', 'get', 'Branch.unlock'])
> +        self.assertThat(calls_after_insert_stream,
> +            MatchesAny(bzr_core_trace, bzr_loom_trace))

This is probably my ignorance, but bzr_loom_trace and bzr_core_trace
look identical. How does this help? Thanks for the forthcoming
education. :-)

-John

Revision history for this message
Robert Collins (lifeless) wrote :

sent to pqm by email

Revision history for this message
Robert Collins (lifeless) wrote :

On Thu, Jun 24, 2010 at 6:40 PM, John Szakmeister <email address hidden> wrote:
> On Thu, Jun 24, 2010 at 4:32 AM, Robert Collins

>> @@ -272,10 +277,14 @@
>>         calls_after_insert_stream = hpss_call_names[insert_stream_idx:]
>>         # After inserting the stream the client has no reason to query the
>>         # remote graph any further.
>> -        self.assertEqual(
>> -            ['Repository.insert_stream_1.19', 'Repository.insert_stream_1.19',
>> -             'get', 'Branch.set_last_revision_info', 'Branch.unlock'],
>> -            calls_after_insert_stream)
>> +        bzr_core_trace = Equals(
>> +            ['Repository.insert_stream_1.19', 'Repository.insert_stream_1.19',
>> +             'get', 'Branch.set_last_revision_info', 'Branch.unlock'])
>> +        bzr_loom_trace = Equals(
>> +            ['Repository.insert_stream_1.19', 'Repository.insert_stream_1.19',
>> +             'get', 'Branch.set_last_revision_info', 'get', 'Branch.unlock'])
>> +        self.assertThat(calls_after_insert_stream,
>> +            MatchesAny(bzr_core_trace, bzr_loom_trace))
>
> This is probably my ignorance, but bzr_loom_trace and bzr_core_trace
> look identical.  How does this help?  Thanks for the forthcoming
> education. :-)

Its a little subtle, and I could have played list slicing tricks to
make it more obvious, but at a cost in reading each trace, so I did it
the way I did.

here's a side-by-side comparison:
'Repository.insert_stream_1.19', 'Repository.insert_stream_1.19',
'Repository.insert_stream_1.19', 'Repository.insert_stream_1.19',
'get', 'get',
'Branch.set_last_revision_info', 'Branch.set_last_revision_info',
'get',
'Branch.unlock' 'Branch.unlock',

-Rob

Revision history for this message
John Szakmeister (jszakmeister) wrote :

On Thu, Jun 24, 2010 at 4:51 AM, Robert Collins
<email address hidden> wrote:
[snip]
> Its a little subtle, and I could have played list slicing tricks to
> make it more obvious, but at a cost in reading each trace, so I did it
> the way I did.
>
> here's a side-by-side comparison:
> 'Repository.insert_stream_1.19',    'Repository.insert_stream_1.19',
> 'Repository.insert_stream_1.19',    'Repository.insert_stream_1.19',
> 'get',                                            'get',
> 'Branch.set_last_revision_info',      'Branch.set_last_revision_info',
> 'get',
> 'Branch.unlock'                             'Branch.unlock',

Bah, I should've seen that. Thank you.

-John

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bzrlib/tests/per_interbranch/test_push.py'
2--- bzrlib/tests/per_interbranch/test_push.py 2010-06-17 06:30:22 +0000
3+++ bzrlib/tests/per_interbranch/test_push.py 2010-06-24 08:32:39 +0000
4@@ -19,6 +19,11 @@
5 from cStringIO import StringIO
6 import os
7
8+from testtools.matchers import (
9+ Equals,
10+ MatchesAny,
11+ )
12+
13 from bzrlib import (
14 branch,
15 builtins,
16@@ -272,10 +277,14 @@
17 calls_after_insert_stream = hpss_call_names[insert_stream_idx:]
18 # After inserting the stream the client has no reason to query the
19 # remote graph any further.
20- self.assertEqual(
21- ['Repository.insert_stream_1.19', 'Repository.insert_stream_1.19',
22- 'get', 'Branch.set_last_revision_info', 'Branch.unlock'],
23- calls_after_insert_stream)
24+ bzr_core_trace = Equals(
25+ ['Repository.insert_stream_1.19', 'Repository.insert_stream_1.19',
26+ 'get', 'Branch.set_last_revision_info', 'Branch.unlock'])
27+ bzr_loom_trace = Equals(
28+ ['Repository.insert_stream_1.19', 'Repository.insert_stream_1.19',
29+ 'get', 'Branch.set_last_revision_info', 'get', 'Branch.unlock'])
30+ self.assertThat(calls_after_insert_stream,
31+ MatchesAny(bzr_core_trace, bzr_loom_trace))
32
33 def disableOptimisticGetParentMap(self):
34 # Tweak some class variables to stop remote get_parent_map calls asking