fixes #383, #369: waiting process not stopped on timeout reached

only in test mode.