[mod_python] Re: Running mod_python tests

Dorneles Treméa dorneles at x3ng.com.br
Mon Oct 8 22:58:10 EDT 2007


Graham,

> From memory, there are log files placed in a subdirectory of the
> 'test' directory where you run the tests from. Can you see any
> evidence of Apache having a 'Segmentation fault', 'SIGSEGV' or other
> form of core dump in the log files. If something is crashing on
> shutdown, it can sometimes result in processes hanging around.

no evidences of SIGSEGVs. Looks like the processes were still
running because when the 'stop' action was fired, Apache server
hasn't still started, or something like that...

But I think I identified the problem: the failures only happens
if I run the tests from outside the 'test' directory, or IOW:

  - 'python test/test.py' fails sometimes
  - 'cd test; python test.py' always works like a charm

My conclusion: it seems that the directory switching is causing
some kind of delay/penality somewhere. If I apply the small patch
bellow then the tests can be run from anywhere, either from the
'test' directory or outside it without any failure... :-)

--- test.py.orig        2007-10-08 22:06:14.000000000 -0300
+++ test.py     2007-10-08 23:45:07.000000000 -0300
@@ -357,7 +357,7 @@
         cmd = '%s %s -k start -f %s' % (httpd, extra, config)
         print "    ", cmd
         os.system(cmd)
-        time.sleep(1)
+        time.sleep(1.5)
         self.httpd_running = 1

     def stopHttpd(self):
@@ -368,7 +368,7 @@
         cmd = '%s -k stop -f %s' % (httpd, config)
         print "    ", cmd
         os.system(cmd)
-        time.sleep(1)
+        time.sleep(1.5)

         # Wait for apache to stop by checking for the existence of
pid the
         # file. If pid file still exists after 20 seconds raise an error.

Thanks once more.

-- 

Dorneles Treméa
X3ng Web Technology
http://nosleepforyou.blogspot.com



More information about the Mod_python mailing list