httpd-test-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geoffrey Young <ge...@modperlcookbook.org>
Subject [RFC] running tests after the server stops
Date Thu, 18 Sep 2003 16:29:28 GMT
hi all...

I'm thinking about implementing a mechansim that allows you to run certain 
tests after the server shuts down.  the rationale behind this is some work 
I'm doing on Devel::Profiler::Apache - the profiler generates statistics 
when the children die off, so I need to either kill the children or shut 
down the server to have some data to test.

now, killing off the children is easy in 1.0 with child_terminate(), but 
that isn't portable to 2.0 from what I can tell.

I have wanted an API for restarting the server midstrean for a while now, 
mainly to test per-server cleanup logic.  for that I currently use

skip ($Apache::TestConfig::WIN32, kill HUP => Apache::TestServer->new->pid);

and that would seem to work as well here, but again with (different) 
portability.

however, what I really want is only one child, which would generate only one 
  file when the server is shutdown.  then I want to be able to use that file 
in additional tests.

after poking around, I think I can hack together a few different options to 
support this:

   - a new command-line option, poststop=foo.t, which would specify tests to 
add after the server is shutdown.

   - treat a directory, t/poststop, as special, feeding the tests in there 
directly to the test harness.

or perhaps something else that somebody here can come up with :)

I can't help but feel there would be other uses for this, but maybe I'm wrong.

ideas?  comments?

--Geoff


Mime
View raw message