Enable test_async_goal_manager (#14419)

This commit is contained in:
Edward Oakes 2021-03-01 14:20:28 -06:00 committed by GitHub
parent 2a28585bb3
commit ff00a89927
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View file

@ -25,6 +25,14 @@ py_test(
deps = [":serve_lib"],
)
py_test(
name = "test_async_goal_manager",
size = "small",
srcs = serve_tests_srcs,
tags = ["exclusive"],
deps = [":serve_lib"],
)
py_test(
name = "test_backend_worker",
size = "small",

View file

@ -12,7 +12,8 @@ async def test_wait_for_goals():
await manager.wait_for_goal(None)
goal_id = manager.create_goal()
waiting = asyncio.create_task(manager.wait_for_goal(goal_id))
loop = asyncio.get_event_loop()
waiting = loop.create_task(manager.wait_for_goal(goal_id))
assert not waiting.done(), "Unfinished task should not be done"
manager.complete_goal(goal_id)