From 5bd1725ef9ced70c3e1e37ab06573184d0d6e524 Mon Sep 17 00:00:00 2001 From: Sergio Durigan Junior Date: Tue, 1 Mar 2016 14:25:29 -0500 Subject: [PATCH] Always delete breakage lockfile if build succeeds --- master.cfg | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/master.cfg b/master.cfg index 6b3f1e5..0b66e4a 100644 --- a/master.cfg +++ b/master.cfg @@ -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 ())