Skip to content

Commit

Permalink
Fixed the issue Unclear buildbot failure email (#71)
Browse files Browse the repository at this point in the history
#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.
  • Loading branch information
slydiman committed Nov 23, 2023
1 parent 0ceb1c5 commit ea1f5a4
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions zorg/buildbot/commands/LitTestCommand.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
from buildbot.process.logobserver import LogLineObserver

class LitLogObserver(LogLineObserver):
# Regular expressions for a kill header line sent from a worker.
kTestLineKill = re.compile(r'command timed out: (.*)')

# Regular expressions for a regular test line.
kTestLineRE = re.compile(r'(\w+): (.*) \(.*\)')

Expand Down Expand Up @@ -42,7 +45,12 @@ def __init__(self, maxLogs=None, parseSummaryOnly=False):
self.parserStarted = not parseSummaryOnly
self.simplifiedLog = False

self.killed = False
self.killReason = None

def hadFailure(self):
if self.killed:
return True
for code in self.failingCodes:
if self.resultCounts.get(code):
return True
Expand Down Expand Up @@ -156,6 +164,13 @@ def outLineReceived(self, line):
self.resultCounts[code] = self.resultCounts.get(code, 0) + 1
return

def headerLineReceived(self, line):
m = self.kTestLineKill.match(line)
if m:
self.killed = True;
self.killReason = m.group(1)


class LitTestCommand(Test):
resultNames = {'FAIL':'unexpected failures',
'XPASS':'unexpected passes',
Expand Down Expand Up @@ -192,6 +207,11 @@ def evaluateCommand(self, cmd):

return SUCCESS

def getResultSummary(self):
if self.logObserver.killed:
return {'step': self.logObserver.killReason}
return super().getResultSummary()

def describe(self, done=False):
description = Test.describe(self, done) or list()

Expand Down

0 comments on commit ea1f5a4

Please sign in to comment.