Always delete breakage lockfile if build succeeds

This commit is contained in:
Sergio Durigan Junior 2016-03-01 14:25:29 -05:00
parent 52e6cb7df1
commit 5bd1725ef9

View file

@ -178,8 +178,8 @@ def SendRootMessageGDBTesters (branch, change):
s.sendmail (GDB_MAIL_FROM, [ GDB_MAIL_TO ], mail.as_string ())
s.quit ()
def make_breakage_lockfile_name (builder):
return "/tmp/gdb-buildbot-breakage-report-%s" % builder
def make_breakage_lockfile_prefix ():
return "/tmp/gdb-buildbot-breakage-report-"
def SendAuthorMessage (name, change, text_prepend):
"""Send a message to the author of the commit if it broke GDB.
@ -189,7 +189,7 @@ people. This may happen, for example, if a commit X breaks GDB, but
subsequent commits are made after X, by different people."""
global GDB_MAIL_FROM
lockfile = make_breakage_lockfile_name (name)
lockfile = "%s%s" % (make_breakage_lockfile_prefix (), name)
if os.path.exists (lockfile):
# This means we have already reported this failure for this
@ -374,7 +374,7 @@ send to the gdb-testers mailing list."""
else:
# There is no build breakage anymore! Yay! Now, let's see if
# we need to clean up any lock file from previous breaks.
lockfile = make_breakage_lockfile_name (name)
lockfile = "%s%s" % (make_breakage_lockfile_prefix (), name)
if os.path.exists (lockfile):
# We need to clean the lockfile. Garbage-collect it here.
os.remove (lockfile)
@ -662,6 +662,16 @@ The parameters of the class are:
self.extra_make_flags = []
self.addStep (self.CompileClass (self.make_command, self.extra_make_flags))
# This last will be executed when the build succeeds. It is
# needed in order to cleanup the breakage lockfile, if it
# exists.
self.addStep (ShellCommand (command = ['/usr/bin/rm', '-f',
WithProperties ('/tmp/gdb-buildbot-breakage-report-%s',
'buildername')],
description = "cleaning up breakage lockfile (if exists)",
descriptionDone = "cleaned up breakage lockfile",
hideStepIf = True))
# Disabling this until we figure out how to properly run + test
# self.addStep (MakeTAGSGDB ())