From 9510f6f05f94cff0e01c22fe0efb8da291620cfc Mon Sep 17 00:00:00 2001 From: filipgolem <44880692+filipgolem@users.noreply.github.com> Date: Mon, 19 Jul 2021 12:33:47 +0200 Subject: [PATCH] Use command_index when calling get_exec_batch_results (#548) * Use command_index when calling get_exec_batch_results * Increase timeouts in the blender integration test * Increase timeouts in the yacat integration test Co-authored-by: azawlocki --- tests/goth_tests/test_run_blender.py | 4 ++-- tests/goth_tests/test_run_yacat.py | 6 +++--- yapapi/rest/activity.py | 6 +++++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/tests/goth_tests/test_run_blender.py b/tests/goth_tests/test_run_blender.py index 485c63ad4..7ef4daa16 100644 --- a/tests/goth_tests/test_run_blender.py +++ b/tests/goth_tests/test_run_blender.py @@ -77,9 +77,9 @@ async def test_run_blender( await all_sent.wait_for_result(timeout=120) logger.info("All tasks sent") - await all_computed.wait_for_result(timeout=30) + await all_computed.wait_for_result(timeout=120) logger.info("All tasks computed, waiting for Executor shutdown") - await cmd_monitor.wait_for_pattern(".*Executor has shut down", timeout=120) + await cmd_monitor.wait_for_pattern(".*Executor has shut down", timeout=180) logger.info("Requestor script finished") diff --git a/tests/goth_tests/test_run_yacat.py b/tests/goth_tests/test_run_yacat.py index 83c21391d..d367a564f 100644 --- a/tests/goth_tests/test_run_yacat.py +++ b/tests/goth_tests/test_run_yacat.py @@ -81,13 +81,13 @@ async def test_run_yacat( ) logger.info("Keyspace found") - await all_sent.wait_for_result(timeout=30) + await all_sent.wait_for_result(timeout=60) logger.info("All tasks sent") - await all_computed.wait_for_result(timeout=60) + await all_computed.wait_for_result(timeout=120) logger.info("All tasks computed") - await cmd_monitor.wait_for_pattern(".*Password found: yo", timeout=10) + await cmd_monitor.wait_for_pattern(".*Password found: yo", timeout=60) logger.info("Password found, waiting for Executor shutdown") await cmd_monitor.wait_for_pattern(".*Executor has shut down", timeout=120) diff --git a/yapapi/rest/activity.py b/yapapi/rest/activity.py index afd4f6cc8..d8e20f36f 100644 --- a/yapapi/rest/activity.py +++ b/yapapi/rest/activity.py @@ -195,7 +195,11 @@ async def __aiter__(self) -> AsyncIterator[events.CommandEventContext]: raise BatchTimeoutError() try: results: List[yaa.ExeScriptCommandResult] = await self._api.get_exec_batch_results( - self._activity_id, self._batch_id, _request_timeout=min(timeout, 5) + self._activity_id, + self._batch_id, + command_index=last_idx, + timeout=min(timeout, 5), + _request_timeout=min(timeout, 5) + 1, ) except asyncio.TimeoutError: continue