def run(self): content = randn(100) req = Ping(ping=content) futures = [] for x in range(100): futures.append(self.client.ping(req)) results = wait_for_all(futures) for r in results : assert N.all(r.pong == content) self.client.close()
def run(self): futures = [] for x in range(100): content = '%s.%d' % (threading.current_thread().name, x) req = Ping(ping=content) futures.append(self.client.ping(req)) results = wait_for_all(futures) #for idx, r in enumerate(results): # content = '%s.%d' % (threading.current_thread().name, idx) # assert N.all(r.pong == content) self.client.close()
def test_reponse(self): with self._connect() as proxy: content = "hello" req = Ping(ping=content) futures = [] test_num = 1000 for x in range(test_num): futures.append(proxy.ping(req)) results = wait_for_all(futures) none_num = 0 for r in results: if r is None: none_num += 1 self.assertEqual(none_num, 0)