Hi Tim, Tim Peters wrote at 2005-8-19 11:15 -0400:
... "The tests are dodgy" sounds appealing until you think about what they do related to the point of failure: spawn a process, and wait for it to exit later, passing waitpid() the pid returned by spawnve(). There just isn't anything complicated (at the Python level) going on there.
There is one essential thing you stress over and over again -- but which I am not sure: You say, the exception in "tearDown" means that the test completed successfully -- without any error. However, I am convinced that "tearDown" is called, too, when the test fails. I did not point this out earlier, because you are probably right. If the test itself had failed, we should probably have seen a previous exception and a "pid" cannot be registered for later clean up before it was created. Looks as if there were something that eats the dead child before the "waitpid" could take care of it. I know that a SIGCHLD/SIG_IGN can do that or a "waitpid(pid)" with "pid <= 0". If for some reason, a value "<= 0" happened to arrive in the list of processes to be cleaned up, then this could explain the strange non-deterministic behaviour. -- Dieter