truncate long error output and summarize failed test cases at the end of a run