示例#1
0
 def reconfigService(self,
                     name,
                     password,
                     build_wait_timeout=60 * 10,
                     **kwargs):
     self._substantiation_notifier = Notifier()
     self._insubstantiation_notifier = Notifier()
     self.build_wait_timeout = build_wait_timeout
     return super().reconfigService(name, password, **kwargs)
示例#2
0
文件: build.py 项目: zmadi1/buildbot
    def __init__(self, requests):
        self.requests = requests
        self.locks = []
        # build a source stamp
        self.sources = requests[0].mergeSourceStampsWith(requests[1:])
        self.reason = requests[0].mergeReasons(requests[1:])

        self.currentStep = None
        self.workerEnvironment = {}
        self.buildid = None
        self._buildid_notifier = Notifier()
        self.number = None
        self.executedSteps = []
        self.stepnames = {}

        self.terminate = False

        self._acquiringLock = None
        self._builderid = None
        # overall results, may downgrade after each step
        self.results = SUCCESS
        self.properties = properties.Properties()

        # tracks execution during the build finish phase
        self._locks_released = False
        self._build_finished = False

        # tracks execution during substantiation
        self._is_substantiating = False

        # tracks the config version for locks
        self.config_version = None
示例#3
0
 def reconfigService(self, name, password,
                     build_wait_timeout=60 * 10,
                     **kwargs):
     self._substantiation_notifier = Notifier()
     self._start_stop_lock = defer.DeferredLock()
     self.build_wait_timeout = build_wait_timeout
     return super().reconfigService(name, password, **kwargs)
 def test_notify_no_waiters(self):
     """
     Calling `Notifier.notify` when there are no waiters does not
     raise.
     """
     n = Notifier()
     n.notify(object())
 def test_nonzero_waiters(self):
     """
     If there are waiters, ``Notifier`` evaluates as `True`.
     """
     n = Notifier()
     n.wait()
     self.assertTrue(n)
示例#6
0
 def checkConfig(self, name, password,
                 build_wait_timeout=60 * 10,
                 **kwargs):
     AbstractWorker.checkConfig(self, name, password, **kwargs)
     self.building = set()
     self.build_wait_timeout = build_wait_timeout
     self._substantiation_notifier = Notifier()
 def test_nonzero_cleared_waiters(self):
     """
     After notifying waiters, ``Notifier`` evaluates as `False`.
     """
     n = Notifier()
     n.wait()
     n.notify(object())
     self.assertFalse(n)
示例#8
0
文件: latent.py 项目: pmisik/buildbot
    def reconfigService(self,
                        name,
                        build_wait_timeout=0,
                        missing_timeout=DEFAULT_MISSING_TIMEOUT,
                        **kwargs):
        yield super().reconfigService(name, **kwargs)
        self.build_wait_timeout = build_wait_timeout
        self.missing_timeout = missing_timeout

        for worker in self.workers:
            if not interfaces.ILatentWorker.providedBy(worker):
                raise Exception(f'Worker is not latent {worker.name}')

        self.state = States.STOPPED
        self._start_notifier = Notifier()
        self._stop_notifier = Notifier()
        self._build_wait_timer = None
        self._missing_timer = None
 def test_notify_failure(self):
     """
     If a failure is passed to `Notifier.notify` then the waiters
     are errback'd.
     """
     n = Notifier()
     d = n.wait()
     n.notify(Failure(TestException()))
     self.failureResultOf(d, TestException)
示例#10
0
 def test_notify_failure(self):
     """
     If a failure is passed to `Notifier.notify` then the waiters
     are errback'd.
     """
     n = Notifier()
     d = n.wait()
     n.notify(Failure(TestException()))
     with self.assertRaises(TestException):
         yield d
示例#11
0
    def test_notify_multiple_waiters(self):
        """
        If there all multiple waiters, `Notifier.notify` fires all
        the deferreds with the same value.
        """
        value = object()
        n = Notifier()
        ds = [n.wait(), n.wait()]
        n.notify(value)

        self.assertEqual((yield ds[0]), value)
        self.assertEqual((yield ds[1]), value)
 def test_notify_multiple_waiters(self):
     """
     If there all multiple waiters, `Notifier.notify` fires all
     the deferreds with the same value.
     """
     value = object()
     n = Notifier()
     ds = [n.wait(), n.wait()]
     n.notify(value)
     self.assertEqual(
         [self.successResultOf(d) for d in ds],
         [value] * 2,
     )
    def test_new_waiters_not_notified(self):
        """
        If a new waiter is added while notifying, it won't be
        notified until the next notification.
        """
        value = object()
        n = Notifier()
        box = []

        def add_new_waiter(_):
            box.append(n.wait())
        n.wait().addCallback(add_new_waiter)
        n.notify(object())
        self.assertNoResult(box[0])
        n.notify(value)
        self.assertEqual(
            self.successResultOf(box[0]),
            value,
        )
示例#14
0
文件: deferwaiter.py 项目: nvg24/lit
 def __init__(self):
     self._waited = {}
     self._finish_notifier = Notifier()
示例#15
0
文件: base.py 项目: nalajcie/buildbot
 def _handle_disconnection_delivery_notifier(self):
     self._pending_disconnection_delivery_notifier = Notifier()
     yield self.conn.waitForNotifyDisconnectedDelivered()
     self._pending_disconnection_delivery_notifier.notify(None)
     self._pending_disconnection_delivery_notifier = None
 def test_wait(self):
     """
     Calling `Notifier.wait` returns a deferred that hasn't fired.
     """
     n = Notifier()
     self.assertNoResult(n.wait())
示例#17
0
 def __init__(self, name):
     self.name = name
     self.subscriptions = set()
     self._unfinished_deliveries = []
     self._unfinished_notifier = Notifier()
 def test_nonzero_no_waiters(self):
     """
     If there no waiters, ``Notifier`` evaluates as `False`.
     """
     n = Notifier()
     self.assertFalse(n)
示例#19
0
 def __init__(self, *args, **kwargs):
     super().__init__(*args, **kwargs)
     self._substantiation_notifier = Notifier()
     self._start_stop_lock = defer.DeferredLock()
     self._deferwaiter = deferwaiter.DeferWaiter()
示例#20
0
 def _handle_conn_shutdown_notifier(self, conn):
     self._pending_conn_shutdown_notifier = Notifier()
     yield conn.waitShutdown()
     self._pending_conn_shutdown_notifier.notify(None)
     self._pending_conn_shutdown_notifier = None
示例#21
0
 def __init__(self, *args, poll_timeout=120, **kwargs):
     super().__init__(*args, **kwargs)
     self._polling_finished_notifier = Notifier()
     self.poll_timeout = poll_timeout