Skip to content

Commit ea1f5a4

Browse files
authored
Fixed the issue Unclear buildbot failure email (#71)
#65 Listen to the `header` TTY stream and monitor the message like `command timed out: 1200 seconds without output running [b'ninja', b'check-clang-unit'], attempting to kill` sent from a worker.
1 parent 0ceb1c5 commit ea1f5a4

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

zorg/buildbot/commands/LitTestCommand.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
from buildbot.process.logobserver import LogLineObserver
1010

1111
class LitLogObserver(LogLineObserver):
12+
# Regular expressions for a kill header line sent from a worker.
13+
kTestLineKill = re.compile(r'command timed out: (.*)')
14+
1215
# Regular expressions for a regular test line.
1316
kTestLineRE = re.compile(r'(\w+): (.*) \(.*\)')
1417

@@ -42,7 +45,12 @@ def __init__(self, maxLogs=None, parseSummaryOnly=False):
4245
self.parserStarted = not parseSummaryOnly
4346
self.simplifiedLog = False
4447

48+
self.killed = False
49+
self.killReason = None
50+
4551
def hadFailure(self):
52+
if self.killed:
53+
return True
4654
for code in self.failingCodes:
4755
if self.resultCounts.get(code):
4856
return True
@@ -156,6 +164,13 @@ def outLineReceived(self, line):
156164
self.resultCounts[code] = self.resultCounts.get(code, 0) + 1
157165
return
158166

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+
159174
class LitTestCommand(Test):
160175
resultNames = {'FAIL':'unexpected failures',
161176
'XPASS':'unexpected passes',
@@ -192,6 +207,11 @@ def evaluateCommand(self, cmd):
192207

193208
return SUCCESS
194209

210+
def getResultSummary(self):
211+
if self.logObserver.killed:
212+
return {'step': self.logObserver.killReason}
213+
return super().getResultSummary()
214+
195215
def describe(self, done=False):
196216
description = Test.describe(self, done) or list()
197217

0 commit comments

Comments
 (0)