def METHOD_NAME(self):
    testcase = self
    class MyStep(steps.MasterShellCommand):
        def _newLog(self, name, type, logid, logEncoding):
            r = super()._newLog(name, type, logid, logEncoding)
            testcase.curr_log = r
            testcase.patch(r, "finish", lambda: defer.fail(RuntimeError('Could not finish')))
            return r
    step = MyStep(command='echo hello')
    yield self.setup_config(step)
    change = {
        "branch": "master",
        "files": ["foo.c"],
        "author": "me@foo.com",
        "committer": "me@foo.com",
        "comments": "good stuff",
        "revision": "HEAD",
        "project": "none"
    }
    build = yield self.doForceBuild(wantSteps=True, useChange=change, wantLogs=True)
    self.assertEqual(build['buildid'], 1)
    self.assertFalse(self.curr_log.finished)
    self.assertEqual(build['results'], EXCEPTION)
    errors = self.flushLoggedErrors()
    self.assertEqual(len(errors), 1)
    error = errors[0]
    self.assertEqual(error.getErrorMessage(), 'Could not finish')