Ticket #2305 (closed defect: fixed)

Opened 12 months ago

Last modified 12 months ago

If doStepIf callable errors out build ends badly

Reported by: Jc2k Owned by:
Priority: major Milestone: 0.8.+
Version: master Keywords: buildstep
Cc:

Description

My callable had the wrong number of arguments so threw a TypeError? inside _maybeEvaluate. The build didn't end cleanly - got stuck in a building state and the build vanished when i restarted.

In this instance, i'm running a snapshot of master from shortly before the big codebases merge with my libvirt patch set applied (that doesn't touch the buildstep code tho).

Change History

comment:1 Changed 12 months ago by dustin

  • Milestone changed from 0.8.7 to 0.8.+

Hm, I get an EXCEPTION status from

f1.addStep(ShellCommand(command="sleep 10", doStepIf=lambda : True))

The exception is ugly, because it's from a DeferredList?, but the state seems to come out correctly.

 (view as text)

Traceback (most recent call last):
Failure: twisted.internet.defer.FirstError: FirstError[#0, [Failure instance: Traceback: <type 'exceptions.TypeError'>: <lambda>() takes no arguments (1 given)
/home/dustin/code/buildbot/t/buildbot/sand27/lib/python2.7/site-packages/twisted/internet/defer.py:301:addCallback
/home/dustin/code/buildbot/t/buildbot/sand27/lib/python2.7/site-packages/twisted/internet/defer.py:290:addCallbacks
/home/dustin/code/buildbot/t/buildbot/sand27/lib/python2.7/site-packages/twisted/internet/defer.py:551:_runCallbacks
/home/dustin/code/buildbot/t/buildbot/master/buildbot/process/buildstep.py:566:_startStep_2
--- <exception caught here> ---
/home/dustin/code/buildbot/t/buildbot/sand27/lib/python2.7/site-packages/twisted/internet/defer.py:134:maybeDeferred
]]

Can you give some more detail on what you're seeing?

comment:2 Changed 12 months ago by Jc2k

Ah my bad - i meant hideStepIf

comment:3 Changed 12 months ago by dustin

Ah, indeed, I get

2012-05-26 18:35:55-0500 [-] BuildStep.failed; traceback follows
        Traceback (most recent call last):
          File "/home/dustin/code/buildbot/t/buildbot/sand27/lib/python2.7/site-packages/twisted/internet/defer.py", line 290, in addCallbacks
            self._runCallbacks()
          File "/home/dustin/code/buildbot/t/buildbot/sand27/lib/python2.7/site-packages/twisted/internet/defer.py", line 551, in _runCallbacks
            current.result = callback(current.result, *args, **kw)
          File "/home/dustin/code/buildbot/t/buildbot/sand27/lib/python2.7/site-packages/twisted/internet/defer.py", line 368, in callback
            self._startRunCallbacks(result)
          File "/home/dustin/code/buildbot/t/buildbot/sand27/lib/python2.7/site-packages/twisted/internet/defer.py", line 464, in _startRunCallbacks
            self._runCallbacks()
        --- <exception caught here> ---
          File "/home/dustin/code/buildbot/t/buildbot/sand27/lib/python2.7/site-packages/twisted/internet/defer.py", line 551, in _runCallbacks
            current.result = callback(current.result, *args, **kw)
          File "/home/dustin/code/buildbot/t/buildbot/master/buildbot/process/buildstep.py", line 636, in finished
            self._finishFinished(results)
          File "/home/dustin/code/buildbot/t/buildbot/master/buildbot/process/buildstep.py", line 645, in _finishFinished
            hidden = self._maybeEvaluate(self.hideStepIf, results, self)
          File "/home/dustin/code/buildbot/t/buildbot/master/buildbot/process/buildstep.py", line 758, in _maybeEvaluate
            value = value(*args, **kwargs)
        exceptions.TypeError: <lambda>() takes no arguments (2 given)

2012-05-26 18:35:55-0500 [-] exception during failure processing
2012-05-26 18:35:55-0500 [-] Unhandled Error
        Traceback (most recent call last):
          File "/home/dustin/code/buildbot/t/buildbot/sand27/lib/python2.7/site-packages/twisted/internet/defer.py", line 551, in _runCallbacks
            current.result = callback(current.result, *args, **kw)
          File "/home/dustin/code/buildbot/t/buildbot/sand27/lib/python2.7/site-packages/twisted/internet/defer.py", line 368, in callback
            self._startRunCallbacks(result)
          File "/home/dustin/code/buildbot/t/buildbot/sand27/lib/python2.7/site-packages/twisted/internet/defer.py", line 464, in _startRunCallbacks
            self._runCallbacks()
          File "/home/dustin/code/buildbot/t/buildbot/sand27/lib/python2.7/site-packages/twisted/internet/defer.py", line 551, in _runCallbacks
            current.result = callback(current.result, *args, **kw)
        --- <exception caught here> ---
          File "/home/dustin/code/buildbot/t/buildbot/master/buildbot/process/buildstep.py", line 662, in failed
            self.progress.finish()
          File "/home/dustin/code/buildbot/t/buildbot/master/buildbot/status/progress.py", line 85, in finish
            self.buildProgress.stepFinished(self.name)
          File "/home/dustin/code/buildbot/t/buildbot/master/buildbot/status/progress.py", line 165, in stepFinished
            assert(stepname not in self.finishedSteps)
        exceptions.AssertionError: 

comment:4 Changed 12 months ago by dustin

That was relatively easy to fix!

Now I get:

 (view as text)

Traceback (most recent call last):
  File "/home/dustin/code/buildbot/t/buildbot/sand27/lib/python2.7/site-packages/twisted/internet/defer.py", line 368, in callback
    self._startRunCallbacks(result)
  File "/home/dustin/code/buildbot/t/buildbot/sand27/lib/python2.7/site-packages/twisted/internet/defer.py", line 464, in _startRunCallbacks
    self._runCallbacks()
  File "/home/dustin/code/buildbot/t/buildbot/sand27/lib/python2.7/site-packages/twisted/internet/defer.py", line 551, in _runCallbacks
    current.result = callback(current.result, *args, **kw)
  File "/home/dustin/code/buildbot/t/buildbot/master/buildbot/process/buildstep.py", line 636, in finished
    self._finishFinished(results)
--- <exception caught here> ---
  File "/home/dustin/code/buildbot/t/buildbot/master/buildbot/process/buildstep.py", line 645, in _finishFinished
    hidden = self._maybeEvaluate(self.hideStepIf, results, self)
  File "/home/dustin/code/buildbot/t/buildbot/master/buildbot/process/buildstep.py", line 766, in _maybeEvaluate
    value = value(*args, **kwargs)
exceptions.TypeError: <lambda>() takes no arguments (2 given)


comment:5 Changed 12 months ago by Dustin J. Mitchell

  • Status changed from new to closed
  • Resolution set to fixed

Handle exceptions in hideStepIf

Fixes #2305.

Changeset: 27bf15c64006b271a1f21fda64628239abfae58e

comment:6 Changed 12 months ago by Dustin J. Mitchell

Handle exceptions in hideStepIf

Fixes #2305.

Changeset: 27bf15c64006b271a1f21fda64628239abfae58e

Note: See TracTickets for help on using tickets.