如何使用多线程/多处理测试框架运行twisted / crochet?

时间:2018-06-08 08:22:37

标签: python multithreading unit-testing multiprocessing twisted

我有一个基于python的unittest模块的测试框架,它使用twisted / crochet连接到设备。如果我们尝试使用多线程并行运行各个测试用例,在某些或其他情况下,我们最终会遇到卡住线程,或者如果使用多处理总是卡在下面的回溯中

 File "/home/rohnigam/discover-automation/cme-automation/tng/tng/proxy/callables.py", line 78, in wrapper                                                            
    return block(func, *args, **kwargs)               
  File "/home/rohnigam/discover-automation/cme-automation/tng/tng/proxy/callables.py", line 36, in _block_with_crochet                                                
    result = eventual_result.wait()
  File "/home/rohnigam/discover-automation/rohit/lib/python2.7/site-packages/crochet/_eventloop.py", line 229, in wait
    result = self._result(timeout)
  File "/home/rohnigam/discover-automation/cme-automation/tng/tng/frontend/dynamic_threadpool.py", line 58, in _EventualResult_result
    return orig(self, *args, **kwargs)
  File "/home/rohnigam/discover-automation/rohit/lib/python2.7/site-packages/crochet/_eventloop.py", line 189, in _result
    self._result_set.wait(timeout)
  File "/usr/lib64/python2.7/threading.py", line 621, in wait
    self.__cond.wait(timeout, balancing)
  File "/usr/lib64/python2.7/threading.py", line 361, in wait
    _sleep(delay)

unittest.TestSuite的运行中,我以多线程/多处理方式调用了各个测试用例的运行。

是否有任何已知的框架以更清洁的方式执行此操作?

0 个答案:

没有答案