Skip to content

Commit

Permalink
buildstep: fix updateSummary race condition
Browse files Browse the repository at this point in the history
Stop trigger integration tests, revelead a race
condition. When updateSummary is called
before the step is started, self.stepid is not set
and thus the setStepStateString(self.stepid, ...)
call failed.

This commit fixes that issue.

Change-Id: I725b9a4f791b1063bdac892be9dca27471f4b452
Signed-off-by: Ion Alberdi <ialberdi@intel.com>
  • Loading branch information
Ion Alberdi committed May 12, 2015
1 parent 2d3f3fe commit 9fba82a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions master/buildbot/process/buildstep.py
Expand Up @@ -319,7 +319,7 @@ def __init__(self, **kwargs):
self.statistics = {}
self.logs = {}
self._running = False

self.stepid = None
self._start_unhandled_deferreds = None

def __new__(klass, *args, **kwargs):
Expand Down Expand Up @@ -415,8 +415,9 @@ def methodInfo(m):
if not isinstance(stepResult, unicode):
raise TypeError("step result string must be unicode (got %r)"
% (stepResult,))
yield self.master.data.updates.setStepStateString(self.stepid,
stepResult)
if self.stepid is not None:
yield self.master.data.updates.setStepStateString(self.stepid,
stepResult)

if not self._running:
buildResult = summary.get('build', None)
Expand Down

0 comments on commit 9fba82a

Please sign in to comment.