'L{ThreadPool.callInThreadWithCallback} logs the exception raised by
C{onResult}.'

def test_callInThreadWithCallbackExceptionInOnResult(self):

    class NewError(Exception, ):
        pass
    waiter = threading.Lock()
    waiter.acquire()
    results = []
    def onResult(success, result):
        results.append(success)
        results.append(result)
        raise NewError()
    tp = threadpool.ThreadPool(0, 1)
    tp.callInThreadWithCallback(onResult, (lambda : None))
    tp.callInThread(waiter.release)
    tp.start()
    try:
        self._waitForLock(waiter)
    finally:
        tp.stop()
    errors = self.flushLoggedErrors(NewError)
    self.assertEqual(len(errors), 1)
    self.assertTrue(results[0])
    self.assertIsNone(results[1])
