mirror of
https://github.com/hatchet-dev/hatchet.git
synced 2026-01-08 17:59:43 -06:00
* feat: expand conditional docs * feat: initial cancellation work + fixing some broken links * feat: docs on cancellation * python: fix cancellation * python: cruft * chore: version * feat: python example * fix: TS cancellation examples * fix: lint * feat: go example * feat: half-baked ts conditional logic workflow * feat: add ts example conditional workflow * feat: go example * feat: go example * fix: cancellation test * fix: thanks, copilot! * Update frontend/docs/pages/home/conditional-workflows.mdx Co-authored-by: Gabe Ruttner <gabriel.ruttner@gmail.com> * fix: lint * chore: lint * fix: longer sleep --------- Co-authored-by: Gabe Ruttner <gabriel.ruttner@gmail.com>
20 lines
537 B
Python
20 lines
537 B
Python
import pytest
|
|
|
|
from examples.timeout.worker import refresh_timeout_wf, timeout_wf
|
|
from hatchet_sdk import Hatchet
|
|
|
|
|
|
@pytest.mark.asyncio()
|
|
async def test_execution_timeout(hatchet: Hatchet) -> None:
|
|
run = timeout_wf.run_no_wait()
|
|
|
|
with pytest.raises(Exception, match="(Task exceeded timeout|TIMED_OUT)"):
|
|
await run.aio_result()
|
|
|
|
|
|
@pytest.mark.asyncio()
|
|
async def test_run_refresh_timeout(hatchet: Hatchet) -> None:
|
|
result = await refresh_timeout_wf.aio_run()
|
|
|
|
assert result["refresh_task"]["status"] == "success"
|