Run tests against out of process smart server

Bug #866111 reported by Martin Packman
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Medium
Unassigned

Bug Description

Currently tests needing a smart server a test specific implementation up in a thread to run against, which is not a very realistic environment and is prone to test-only issues such as hangs. Instead, tests should use the real smart server, running in a separate process, which is more typical of actual usage and should be easier to manage when things go wrong.

By using testresources, which bug 866107 covers the introduction of, it should be possible to avoid needing to spawn a new process for every test and thereby minimise the overhead.

Martin Packman (gz)
tags: added: selftest
Changed in bzr:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
John A Meinel (jameinel) wrote :

Sounds like a good idea. One thing that the current one does well is to get any exceptions from the smart server code and get them to be raised in the test suite, rather than just as stipple on stderr.

It would be nice to add this.

The other potentially difficult part is getting the current working dir playing nicely in the separate process, vs what the test suite expects. Especially since to prevent exposing content, we chroot the smart server process.

In the test suite, we use an internal api to say "it is ok for you to open up branches in this directory", but that isn't something we would want to expose on a generic server. If necessary we could expose it for just the test server.

We could do something like read stderr for exceptions, and re-raise them, etc.

However, we could also set up a test-suite manhole, so that we can pass in "allow this directory" requests, and also "were there any exceptions?"

Revision history for this message
Martin Pool (mbp) wrote : Re: [Bug 866111] Re: Run tests against out of process smart server

On 4 October 2011 23:11, John A Meinel <email address hidden> wrote:
> Sounds like a good idea. One thing that the current one does well is to
> get any exceptions from the smart server code and get them to be raised
> in the test suite, rather than just as stipple on stderr.

We could have the external process write to a log file, and then
attach that file to the test result, and truncate it after each test.

>
> It would be nice to add this.
>
> The other potentially difficult part is getting the current working dir
> playing nicely in the separate process, vs what the test suite expects.
> Especially since to prevent exposing content, we chroot the smart server
> process.
>
> In the test suite, we use an internal api to say "it is ok for you to
> open up branches in this directory", but that isn't something we would
> want to expose on a generic server. If necessary we could expose it for
> just the test server.

We could arrange for the server to run across the whole test
directory, and then to pass paths relative to that.

Martin Pool (mbp)
Changed in bzr:
assignee: nobody → Martin Packman (gz)
Martin Packman (gz)
Changed in bzr:
assignee: Martin Packman (gz) → nobody
Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.