def test_multicall_with_lock_held(self): self.config(debug=True) self.assertFalse(rpc._check_for_lock()) @lockutils.synchronized('detecting', 'test-') def f(): self.assertTrue(rpc._check_for_lock()) f() self.assertFalse(rpc._check_for_lock())
def _fake_rpc_method_timeout(*args, **kwargs): rpc._check_for_lock() self.fake_args = args self.fake_kwargs = kwargs raise rpc_common.Timeout("The spider got you")
def _fake_rpc_method(*args, **kwargs): rpc._check_for_lock() self.fake_args = args self.fake_kwargs = kwargs if has_retval: return expected_retval
def f(): self.assertTrue(rpc._check_for_lock())