Re: [exim-dev] Preliminary testing of a new Exim test suite

Pàgina inicial
Delete this message
Reply to this message
Autor: Daniel Tiefnig
Data:  
A: exim-dev
Assumpte: Re: [exim-dev] Preliminary testing of a new Exim test suite
John Jetmore wrote:
> Test Basic/0090 failed with a different error than Daniel's, but
> again I think it's the situation where the root cause is that 'exim'
> is hard coded somewhere, with Daniel having an 'exim' user and me
> not.


Ok, allready thought that, as it would be an easy explanation.

> My system also ran successfully the plaintext-OpenSSL/3463


This one fails for me randomly at "Command 5", but I think I've found
the reason. When it fails, I get in spool/log/mainlog:

2005-10-21 14:05:47 exim x.yz daemon started: pid=5944, no queue runs,
listening for SMTP on port 1225 (IPv4)
2005-10-21 14:05:48 socket bind() to port 1225 for address (any IPv4)
failed: Address already in use: waiting 30s before trying again (9 more
tries)
2005-10-21 14:06:18 exim x.yz daemon started: pid=5956, no queue runs,
listening for SMTP on port 1225 (IPv4)

There is a small race condition caused by a subtle bug in the
"killdaemon" command of "runtest". It says:

| close DAEMONCMD; # Waits for process


This is actually not completely true. It's correct, that close also
waits for the child process to finish after the pipe was closed, but as
exim double-forks after execution, close waits for e.g. PID 9920, while
exim allready has PID 9922. A simple fix would be:

sleep 1 until system("sudo /bin/kill -0 $pid");

Just after the close() on line 1091 of runtest. Of course this will lead
to an endless loop if we fail to kill our process, so something like
this might be better:

for(1..3)
{
system("sudo /bin/kill -0 $pid") and last;
sleep 1;
}
tests_exit(-1, "Failed to kill daemon $pid)
if system("sudo /bin/kill -0 $pid")

Just at the same place. I think signal "0" is supported on all relevant
platforms. It should be at least, shouldn't it?


lg,
daniel