Fix infinite loop when test log file is only one line long