adding timeout option and fixing output of a failed state
Merge pull request #4539 from ranl/develop

adding timeout option and fixing output of a failed state