Skip to content

Commit

Permalink
Merge branch 'master' of git://github.com/catlee/buildbot
Browse files Browse the repository at this point in the history
* 'master' of git://github.com/catlee/buildbot:
  Fix error handling for _startCommand so that tracebacks get back to the
  • Loading branch information
Dustin J. Mitchell committed May 19, 2010
2 parents 900f113 + 2839603 commit 71edd6f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 4 additions & 1 deletion buildbot/slave/commands/base.py
@@ -1,6 +1,6 @@
# -*- test-case-name: buildbot.test.test_slavecommand -*-

import os, signal, types, time, re
import os, signal, types, time, re, traceback
from stat import ST_CTIME, ST_MTIME, ST_SIZE
from collections import deque

Expand Down Expand Up @@ -390,6 +390,9 @@ def start(self):
except:
log.msg("error in ShellCommand._startCommand")
log.err()
self._addToBuffers('stderr', "error in ShellCommand._startCommand\n")
self._addToBuffers('stderr', traceback.format_exc())
self._sendBuffers()
# pretend it was a shell error
self.deferred.errback(AbandonChain(-1))
return self.deferred
Expand Down
8 changes: 8 additions & 0 deletions buildbot/test/unit/test_slave_commands_base.py
Expand Up @@ -162,6 +162,14 @@ def testBadCommand(self):
def check(err):
self.flushLoggedErrors()
err.trap(AbandonChain)
stderr = []
# Here we're checking that the exception starting up the command
# actually gets propogated back to the master.
for u in b.updates:
if 'stderr' in u:
stderr.append(u['stderr'])
stderr = "".join(stderr)
self.failUnless("TypeError" in stderr, stderr)
d.addBoth(check)
return d

Expand Down

0 comments on commit 71edd6f

Please sign in to comment.