bug fix, test return right result code when test is failed