Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use command_index when calling get_exec_batch_results #548

Merged
merged 8 commits into from
Jul 19, 2021
4 changes: 2 additions & 2 deletions tests/goth_tests/test_run_blender.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this change is okay, the time between the moment the last task is sent and the moment the last task is computed should not be that long.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know, but it seems that sometimes it takes more than 30s to render the image and send it back. I had to run the test again multiple times without this change.

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")
6 changes: 3 additions & 3 deletions tests/goth_tests/test_run_yacat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comment for test_run_blender.py.

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)
Expand Down
6 changes: 5 additions & 1 deletion yapapi/rest/activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down