mirror of https://github.com/m-labs/artiq.git
worker test: do not close the event loop twice
This commit is contained in:
parent
60bdf74137
commit
50a6da994e
|
@ -40,21 +40,18 @@ def _call_worker(worker, expid):
|
||||||
|
|
||||||
|
|
||||||
def _run_experiment(experiment):
|
def _run_experiment(experiment):
|
||||||
try:
|
expid = {
|
||||||
expid = {
|
"file": sys.modules[__name__].__file__,
|
||||||
"file": sys.modules[__name__].__file__,
|
"experiment": experiment,
|
||||||
"experiment": experiment,
|
"arguments": dict()
|
||||||
"arguments": dict()
|
}
|
||||||
}
|
handlers = {
|
||||||
handlers = {
|
"init_rt_results": lambda description: None
|
||||||
"init_rt_results": lambda description: None
|
}
|
||||||
}
|
|
||||||
|
|
||||||
loop = asyncio.get_event_loop()
|
loop = asyncio.get_event_loop()
|
||||||
worker = Worker(handlers)
|
worker = Worker(handlers)
|
||||||
loop.run_until_complete(_call_worker(worker, expid))
|
loop.run_until_complete(_call_worker(worker, expid))
|
||||||
finally:
|
|
||||||
loop.close()
|
|
||||||
|
|
||||||
|
|
||||||
class WatchdogCase(unittest.TestCase):
|
class WatchdogCase(unittest.TestCase):
|
||||||
|
|
Loading…
Reference in New Issue