Example #1
0
    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())
Example #2
0
    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())
Example #3
0
 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")
Example #4
0
 def _fake_rpc_method(*args, **kwargs):
     rpc._check_for_lock()
     self.fake_args = args
     self.fake_kwargs = kwargs
     if has_retval:
         return expected_retval
Example #5
0
 def f():
     self.assertTrue(rpc._check_for_lock())
Example #6
0
 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")
Example #7
0
 def _fake_rpc_method(*args, **kwargs):
     rpc._check_for_lock()
     self.fake_args = args
     self.fake_kwargs = kwargs
     if has_retval:
         return expected_retval
Example #8
0
 def f():
     self.assertTrue(rpc._check_for_lock())