This is an archive of the discontinued LLVM Phabricator instance.

[zorg] LitTestCommand aborts if Verbose log line is not preceded by a valid test status line.
ClosedPublic

Authored by rfoos on Apr 17 2015, 4:17 PM.

Details

Summary

Lit expects a test status line (kTestLineRE) before a verbose log start marker (kTestVerboseLogStartRE).

FAIL: LLDB :: asdf (9 of 20)
*** TEST 'LLDB :: asdf' FAIL ***

If the test status line is malformed, LitTestCommand has an exception at outLineReceived, and testInfoFinished because lastTestResult is None.

FAIL: LLDB :: asdf
*** TEST 'LLDB :: asdf' FAIL ***

Another case of mismatched status/log lines skips the log entry.

This patch handles lastTestResult is None, and skips the log entry.

Diff Detail

Event Timeline

rfoos updated this revision to Diff 23972.Apr 17 2015, 4:17 PM
rfoos retitled this revision from to [zorg] LitTestCommand aborts if Verbose log line is not preceded by a valid test status line..
rfoos updated this object.
rfoos edited the test plan for this revision. (Show Details)
rfoos added a subscriber: Unknown Object (MLST).
rfoos set the repository for this revision to rL LLVM.
rfoos added a project: Restricted Project.
rfoos updated this object.
rfoos edited the test plan for this revision. (Show Details)
gkistanova accepted this revision.Apr 21 2015, 2:36 PM
gkistanova edited edge metadata.

Assuming you will fix the cosmetic issue I have commented in-line.

zorg/buildbot/commands/LitTestCommand.py
63

Maybe handle it the other way around?
Handling the normal case first and the error case at the end. Something like:

if self.lastTestResult:
   # We have finished getting information for one test, handle it.
   code, name = self.lastTestResult
   ...
else:
   # We could get a malformed test status line.
   # Report an issue for verbose mode and skip it.
   if self.lastTestResult is None:
   ...

# Reset the current state.
self.lastTestResult = None
self.activeVerboseLog = None
This revision is now accepted and ready to land.Apr 21 2015, 2:36 PM
rfoos updated this revision to Diff 24177.Apr 21 2015, 3:15 PM
rfoos edited edge metadata.
rfoos removed rL LLVM as the repository for this revision.

Changed testInfoFinished so normal case is first.

rfoos closed this revision.Apr 21 2015, 3:19 PM