J
John Miller
Greetings All:
I'm writing a script that calls an external program using popen. The
program has the potential to run forever, but I what to kill it if it
has not found a solution in 10 seconds. I have therefore set up a
Thread that 'sleep's for 10 seconds and then calls Process.kill on the
PID. I've been successful in mocking out the popen call and Process,
but I am having trouble writing a test that ensures the thread will be
killed. Test::Unit seems to ignore/override threads.
Can anyone give me some advice on how to test threads? It would be
really nice if I didn't have to actually wait the full 10 seconds
either.
John Miller
I'm writing a script that calls an external program using popen. The
program has the potential to run forever, but I what to kill it if it
has not found a solution in 10 seconds. I have therefore set up a
Thread that 'sleep's for 10 seconds and then calls Process.kill on the
PID. I've been successful in mocking out the popen call and Process,
but I am having trouble writing a test that ensures the thread will be
killed. Test::Unit seems to ignore/override threads.
Can anyone give me some advice on how to test threads? It would be
really nice if I didn't have to actually wait the full 10 seconds
either.
John Miller