Hi,
I've been looking a bit at SpawnProcess, and I'm planning to do some
changes to it. The most important change is make
BaseTestCase.readProcessOutput use the class, since reading the output
from the subprocess requires extra code that should be isolated to one
location. There is reason to believe a problem with readProcessOutput is
the cause of the interrupt-related errors reported recently by Myrna
and, possibly, Kathey.
What's troubling me are the arguments destroy and timeout, especially
the combination of the two.
For me, a timeout implies destroy == true. Specifying a timeout and
setting destroy to false is effectively the same as setting destroy to
true, since destroy will be forced to true when a timeout occurs.
For automated test runs it would be best if complete() always returns,
although many test framworks have mechanisms to kill the main process if
it takes too long. For debugging it may be best to keep the subprocess
running and the main process hanging to allow for inspection. I think it
should be possible to obtain the stack (java stack or native stack) of
the subprocess, then kill it manually to get stdout/stderr and have the
main process continue.
I'd prefer to settle on one of two approaches, since that would simplify
the code and define a consistent behavior:
a) Never destroy the process.
b) Always destroy the process if hanging for more than a default
amount of time.
Opinions?
Regards,
--
Kristian