Skip to content

Commit

Permalink
Minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
cretz committed Oct 24, 2023
1 parent 67a46a7 commit 55953e3
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
2 changes: 2 additions & 0 deletions temporalio/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,8 @@ async def start_workflow(
memo: Memo for the workflow.
search_attributes: Search attributes for the workflow.
start_delay: Amount of time to wait before starting the workflow.
This does not work with ``cron_schedule``. This is currently
experimental.
start_signal: If present, this signal is sent as signal-with-start
instead of traditional workflow start.
start_signal_args: Arguments for start_signal if start_signal
Expand Down
24 changes: 24 additions & 0 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,30 @@ async def test_start_delay(
)


async def test_signal_with_start_delay(
client: Client, worker: ExternalWorker, env: WorkflowEnvironment
):
if env.supports_time_skipping:
pytest.skip("Java test server does not support start delay")
start_delay = timedelta(hours=1, minutes=20, seconds=30)
handle = await client.start_workflow(
"kitchen_sink",
KSWorkflowParams(
actions=[KSAction(result=KSResultAction(value="some result"))]
),
id=f"workflow-{uuid.uuid4()}",
task_queue=worker.task_queue,
start_delay=start_delay,
start_signal="some-signal",
)
# Check that first event has start delay
first_event = [e async for e in handle.fetch_history_events()][0]
assert (
start_delay
== first_event.workflow_execution_started_event_attributes.first_workflow_task_backoff.ToTimedelta()
)


async def test_result_follow_continue_as_new(
client: Client, worker: ExternalWorker, env: WorkflowEnvironment
):
Expand Down

0 comments on commit 55953e3

Please sign in to comment.