wait for test process to exit, instead of sleep