fix(tests): fix batches test

This commit is contained in:
psychedelicious 2023-08-22 01:48:53 +10:00
parent be971617e3
commit 68f6140685

View File

@ -180,8 +180,17 @@ def test_can_create_batch(mock_invoker: Invoker, simple_graph, simple_batch):
)
assert batch_process_res.batch_id
assert len(batch_process_res.session_ids) == 25
for session in batch_process_res.session_ids:
assert mock_invoker.services.graph_execution_manager.get(session)
# TODO: without the mock events service emitting the `graph_execution_state` events,
# the batch sessions do not know when they have finished, so this logic will fail
# mock_invoker.services.batch_manager.run_batch_process(batch_process_res.batch_id)
# def has_executed_all_batches(batch_id: str):
# batch_sessions = mock_invoker.services.batch_manager.get_sessions(batch_id)
# print(batch_sessions)
# return all((s.state == "completed" for s in batch_sessions))
# wait_until(lambda: has_executed_all_batches(batch_process_res.batch_id), timeout=10, interval=1)
def test_can_create_bad_batches():