mirror of
https://github.com/hatchet-dev/hatchet.git
synced 2026-01-04 07:39:43 -06:00
* api changes * doc changes * move docs * generated * generate * pkg * backmerge main * revert to main * revert main * race? * remove go tests
28 lines
703 B
Python
28 lines
703 B
Python
import asyncio
|
|
import time
|
|
|
|
import pytest
|
|
|
|
from examples.rate_limit.worker import rate_limit_workflow
|
|
|
|
|
|
@pytest.mark.skip(reason="The timing for this test is not reliable")
|
|
@pytest.mark.asyncio(loop_scope="session")
|
|
async def test_run() -> None:
|
|
|
|
run1 = rate_limit_workflow.run_no_wait()
|
|
run2 = rate_limit_workflow.run_no_wait()
|
|
run3 = rate_limit_workflow.run_no_wait()
|
|
|
|
start_time = time.time()
|
|
|
|
await asyncio.gather(run1.aio_result(), run2.aio_result(), run3.aio_result())
|
|
|
|
end_time = time.time()
|
|
|
|
total_time = end_time - start_time
|
|
|
|
assert (
|
|
1 <= total_time <= 5
|
|
), f"Expected runtime to be a bit more than 1 seconds, but it took {total_time:.2f} seconds"
|