def test_do_not_stop_on_exception(self): self.useFixture(fixture.SleepFixture()) self.num_runs = 2 timer = loopingcall.FixedIntervalLoopingCall(self._raise_and_then_done) res = timer.start(interval=0.5, stop_on_exception=False).wait() self.assertFalse(res)
def setUp(self): super(GuestTestCase, self).setUp() self.useFixture(fakelibvirt.FakeLibvirtFixture()) self.host = host.Host("qemu:///system") self.context = context.get_admin_context() self.domain = mock.Mock(spec=fakelibvirt.virDomain) self.guest = libvirt_guest.Guest(self.domain) # Make RetryDecorator not actually sleep on retries self.useFixture(service_fixture.SleepFixture())
def setUp(self): super(FixtureTestCase, self).setUp() self.sleepfx = self.useFixture(fixture.SleepFixture())
def test_repeat(self): self.useFixture(fixture.SleepFixture()) self.num_runs = 2 timer = loopingcall.DynamicLoopingCall(self._wait_for_zero) self.assertFalse(timer.start().wait())
def test_do_not_stop_on_exception(self): self.useFixture(fixture.SleepFixture()) self.num_runs = 2 timer = loopingcall.DynamicLoopingCall(self._raise_and_then_done) timer.start(stop_on_exception=False).wait()
def test_repeat(self): self.useFixture(fixture.SleepFixture()) self.num_runs = 2 timer = loopingcall.FixedIntervalLoopingCall(self._wait_for_zero) self.assertFalse(timer.start(interval=0.5).wait())
def setUp(self): super(MountTestCase, self).setUp() # Make RetryDecorator not actually sleep on retries self.useFixture(service_fixture.SleepFixture())