|
9 | 9 | from buildbot.process.logobserver import LogLineObserver
|
10 | 10 |
|
11 | 11 | class LitLogObserver(LogLineObserver):
|
| 12 | + # Regular expressions for a kill header line sent from a worker. |
| 13 | + kTestLineKill = re.compile(r'command timed out: (.*)') |
| 14 | + |
12 | 15 | # Regular expressions for a regular test line.
|
13 | 16 | kTestLineRE = re.compile(r'(\w+): (.*) \(.*\)')
|
14 | 17 |
|
@@ -42,7 +45,12 @@ def __init__(self, maxLogs=None, parseSummaryOnly=False):
|
42 | 45 | self.parserStarted = not parseSummaryOnly
|
43 | 46 | self.simplifiedLog = False
|
44 | 47 |
|
| 48 | + self.killed = False |
| 49 | + self.killReason = None |
| 50 | + |
45 | 51 | def hadFailure(self):
|
| 52 | + if self.killed: |
| 53 | + return True |
46 | 54 | for code in self.failingCodes:
|
47 | 55 | if self.resultCounts.get(code):
|
48 | 56 | return True
|
@@ -156,6 +164,13 @@ def outLineReceived(self, line):
|
156 | 164 | self.resultCounts[code] = self.resultCounts.get(code, 0) + 1
|
157 | 165 | return
|
158 | 166 |
|
| 167 | + def headerLineReceived(self, line): |
| 168 | + m = self.kTestLineKill.match(line) |
| 169 | + if m: |
| 170 | + self.killed = True; |
| 171 | + self.killReason = m.group(1) |
| 172 | + |
| 173 | + |
159 | 174 | class LitTestCommand(Test):
|
160 | 175 | resultNames = {'FAIL':'unexpected failures',
|
161 | 176 | 'XPASS':'unexpected passes',
|
@@ -192,6 +207,11 @@ def evaluateCommand(self, cmd):
|
192 | 207 |
|
193 | 208 | return SUCCESS
|
194 | 209 |
|
| 210 | + def getResultSummary(self): |
| 211 | + if self.logObserver.killed: |
| 212 | + return {'step': self.logObserver.killReason} |
| 213 | + return super().getResultSummary() |
| 214 | + |
195 | 215 | def describe(self, done=False):
|
196 | 216 | description = Test.describe(self, done) or list()
|
197 | 217 |
|
|
0 commit comments