Пример #1
0
 def test_HIGH_pool_resize_20(self):
     HIGH.resize(20)
     if HIGH.size() != 20:
         raise "Resize to 20 threads failed."
     for i in xrange(0, 100):
         HIGH.queue(self.simple_action, self)
     t1 = time.time()
     while self.simple_action_counter < 100:
         tn = time.time()
         if (tn - t1) > 3.0:
             raise (
                 "Taking ridiculously long to process 100 queued actions.")
         time.sleep(0.1)
     return
Пример #2
0
 def test_HIGH_pool_resize_20(self):
     HIGH.resize(20)
     if HIGH.size() != 20:
         raise "Resize to 20 threads failed."
     for i in xrange(0,100):
         HIGH.queue(self.simple_action, self)
     t1 = time.time()
     while self.simple_action_counter < 100:
         tn = time.time()
         if (tn-t1) > 3.0:
             raise (
                 "Taking ridiculously long to process 100 queued actions."
                 )
         time.sleep(0.1)
     return
Пример #3
0
 def test_HIGH_pool_1(self):
     t1 = time.time()
     pending_result = HIGH.queue(self.simple_action, self)
     result = pending_result.result(10.0)
     t2 = time.time()
     if result != 'simple_action_result':
         raise ("pending_result.result() returned the wrong value (%s)." %
                result)
     if (t2 - t1) >= 10.0:
         raise "pending_result.result() blocked for no reason."
     return
Пример #4
0
 def test_HIGH_pool_1(self):
     t1 = time.time()
     pending_result = HIGH.queue(self.simple_action, self)
     result = pending_result.result(10.0)
     t2 = time.time()
     if result != 'simple_action_result':
         raise (
             "pending_result.result() returned the wrong value (%s)." %
             result
             )
     if (t2-t1) >= 10.0:
         raise "pending_result.result() blocked for no reason."
     return