On Wednesday 01 December 2004 21:54 CET Daniel Quinlan wrote:
> "Malte S. Stretz" <[EMAIL PROTECTED]> writes:
> > 1.  It has to work also if only single tests are run, so can't rely on
> > a 99_stop_spamd.t to clean up.
> >
> > 2.  It would change the test semantics.  Currently each test is run on
> > a clean spamd.  If the spamd was persistent, a test could fail because
> > of some bug hidden somewhere else.  Not that finding ng these bugs was
> > a bad thing but it would make the tests a bit non-deterministic.
>
> Here's an optimization to greatly reduce unnecessary start/stop.
>
> After running each test, leave spamd running and store the flags and
> configuration that were used to run spamd.  In the next test:
>
>   - if the flags were changed, stop and restart spamd
>   - else if the configuration was changed, kill -HUP spamd

With the latter we have to watch out for systems which don't support HUP 
(currently tested by spamd_hup.t).  I guess a better idea would be 
completely restart the deamon in those cases.  If the tests are in an 
optimized order, the reloading of spamd could even kept at a minimum.  

> I think it would be good, not just for performance reasons, to reuse
> spamd processes when possible, because it might turn up somewhat more
> complex issues.

But there's still the first issue.  What about one of this:

1.  The complex solution:  Parallel to spamd an extra test daemon is 
started.  Each running test creates some pid file.  The test daemon checks 
regularly if that process is still runnig, if not it kills the daemon.

2.  The (maybe) easier solution:  I try to find a way to feed the names of 
the tests run to the scripts themselves (with some more Makefile.PL 
hacking) and the last one tears down spamd.

3.  The lazy solution:  spamd just keeps running, a 99_stop_spamd.t tears it 
down.  If somebody wants to run single tests manually, they have to take 
care of spamd themselves.

4.  We start and stop spamd as we already do.


My "votes" in ascending order:  I'm totally opposed (as in < 0) to 3 and 1 
sounds a bit complex to me (~ +-0), I would keep with 4 instead.  If 2 is 
possible, thats IMO the way to go.

Cheers,
Malte

-- 
[SGT] Simon G. Tatham: "How to Report Bugs Effectively"
      <http://www.chiark.greenend.org.uk/~sgtatham/bugs.html>
[ESR] Eric S. Raymond: "How To Ask Questions The Smart Way"
      <http://www.catb.org/~esr/faqs/smart-questions.html>

Reply via email to