Merging changes for Bazaar beyond the default python

Martin (gzlist) gzlist at googlemail.com
Mon Nov 2 16:00:18 GMT 2009


On 02/11/2009, Ian Clatworthy <ian.clatworthy at canonical.com> wrote:
>
> Please do. First off, I'd be curious to find out how we turn the yellow
> ones to green. Is there low hanging fruit there?

This is a good question, and the short answer is yes. However, I've
got a small confession, a fair bit of the yellow comes from a hack I
injected into the test suite to find issues with file lifetimes. It
can be got with:

bzr branch http://float.endofinternet.org/bazaar/simple/filehack/

The cases it pointed out in bzrlib proper got patched early on, but I
refrained from straying into the tests. That flavour of yellow is
harmless on cpython, it's just a good indicator of orange and red for
IronPython and Jython. As there's been various talk on the list about
cleaning up or rearranging bits of the test suite, discussing before
poking seemed sensible.

To see some examples, I've put up a preliminary version of the test
output for Python 2.4 on Windows XP. This is still a way from
polished, but you can select any of the little coloured rectangles to
get the details on that test or suite. I've not linked a complete run
to spare anyone using a ropey browser.

A fair bit of the yellow is really simple stuff:
http://float.endofinternet.org/temp/bazaar_dev_r4780+filelifetimes_nonper#bt.test_merge_core.FunctionalMergeTest

Sticking a method on TestCaseWithTransport like:

    def wb(self, filename, contents):
        f = file(filename, "wb")
        try:
            f.write(contents)
        finally:
            f.close()

And a little sed would be one option.

Some just want t.get('format').read() to t.get_bytes('format') and so on:
http://float.endofinternet.org/temp/bazaar_dev_r4780+filelifetimes_nonper#bt.test_workingtree_4.TestWorkingTreeFormat4.test_disk_layout

Missed a few places in bzrlib when I did the initial pass:
http://float.endofinternet.org/temp/bazaar_dev_r4780+filelifetimes_nonper#bt.test_http.TestProxyAuth.test_no_prompt_for_password_when_using_auth_config

Many of the HTTP tests seem to have cleanup issues (the "343 non-main
threads were left active in the end" thing worries me too):
http://float.endofinternet.org/temp/bazaar_dev_r4780+filelifetimes_nonper#bt.test_http.TestHTTPSilentRedirections.test_one_redirection

There's also a little LockableFiles noise:
http://float.endofinternet.org/temp/bazaar_dev_r4780+filelifetimes_nonper#bt.test_remote.TestStacking.test_stacked_pull_more_than_stacking_has_bug_360791

Anyway, just rewriting a few lines to do with files in these tests
seems suspect when some look like they could do with bigger changes.
I'd like there to be less IO altogether, takes going on for an hour
and a half to run all of selftest here, and that's with a filesystem
in ram.


On 02/11/2009, Martin Pool <mbp at canonical.com> wrote:
>
> That's great.  Please do put up merge proposals as you go along rather
> than having one big landing that fixes everything.

I know I've been a little bad here, and lots of these changes would
separate out okay. Taken one at a time though it's just a lot of ugly
workarounds, and it still needs more refactoring to win back some code
cleanliness. I'll do a merge request through launchpad if you think
that's the right next step.

Martin



More information about the bazaar mailing list