Skip to content

Commit

Permalink
fix test_run
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramimashkouk committed Dec 27, 2024
1 parent 74205f8 commit 44d39aa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions backend/chatsky_ui/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@

@pytest.fixture(scope="session")
def dummy_build_id() -> int:
return 999999
return 0


@pytest.fixture(scope="session")
def dummy_run_id() -> int:
return 999999
return 0


async def start_process(async_client: AsyncClient, endpoint, preset_end_status) -> httpx.Response:
Expand Down
16 changes: 9 additions & 7 deletions backend/chatsky_ui/tests/integration/test_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,20 @@ async def test_start_run(override_dependency, preset_status, expected_status, du
try:
await asyncio.wait_for(process.process.wait(), timeout=RUN_RUNNING_TIMEOUT)
except asyncio.exceptions.TimeoutError as exc:
if preset_status == "loop":
if preset_status == "success":
logger.debug("Success run process timed out. Expected behavior.")

current_status = await process_manager.get_status(process_id)
assert (
current_status == expected_status
), f"Current process status '{current_status}' did not match the expected '{expected_status}'"
await process.stop()
elif preset_status == "loop":
logger.debug("Loop process timed out. Expected behavior.")
assert True
await process.stop()
return
else:
raise Exception(
f"Process with expected end status '{preset_status}' timed out with "
f"return code '{process.process.returncode}'."
) from exc

current_status = await process_manager.get_status(process_id)
assert (
current_status == expected_status
), f"Current process status '{current_status}' did not match the expected '{expected_status}'"

0 comments on commit 44d39aa

Please sign in to comment.