Skip to content

Stamp the time-skipping config on update-with-start workflows - #2017

Open
LindseyZ1205 wants to merge 1 commit into
temporalio:mainfrom
LindseyZ1205:fix/time-skipping-update-with-start
Open

LindseyZ1205 wants to merge 1 commit into
temporalio:mainfrom
LindseyZ1205:fix/time-skipping-update-with-start

Conversation

@LindseyZ1205

Copy link
Copy Markdown
Contributor

TimeSkipper and WorkflowEnvironment.start_time_skipping_v2() stamp a TimeSkippingConfig on every workflow started through their client, but _TimeSkippingConfigOutbound only sets time_skipping_config in start_workflow(). Update-with-start goes through start_update_with_start_workflow() instead, so a workflow started with execute_update_with_start_workflow() or start_update_with_start_workflow() runs without time skipping, and its timers fire in real time. UpdateWithStartStartWorkflowInput.time_skipping_config exists and is sent in the start request, but nothing sets it.

For example, in an environment from start_time_skipping_v2(), a workflow that sleeps for an hour returns in about a second when it's started with start_workflow(). Started with execute_update_with_start_workflow(), the same workflow has no time_skipping_config in its WorkflowExecutionStarted event, get_time_skipping_info() returns None for it, and it's still waiting for its timer 10 seconds later.

This change sets the config in start_update_with_start_workflow() too, unless time skipping is disabled with with_time_skipping_disabled(), as in start_workflow(). In the review of #1959, signal-with-start was found to go through start_workflow(); update-with-start is the other way to start a workflow from the client.

test_update_with_start_stamps_time_skipping_config in tests/testing/test_timeskipping_v2.py does what test_signal_with_start_stamps_time_skipping_config does, with update-with-start. It checks the time skipping info of the workflow before waiting for its result, so on main it fails right away (assert None is not None) instead of waiting for the timer.

Time Skipping V2 isn't released yet (changelog/added/leapfrogging-lemur.md is still there), so, as in #1973, I didn't add a changelog fragment.

Validation, with Python 3.12, the local dev server (v1.8.3-server-1.32.0-162.0), and the Rust bridge of the temporalio 1.34.0 wheel:

  • tests/testing/test_timeskipping_v2.py (21 tests) and tests/worker/test_update_with_start.py (34 tests) pass.
  • ruff check --select I and ruff format --check (ruff 0.15.22), pyright 1.1.403, basedpyright 1.34.0 and mypy --namespace-packages --check-untyped-defs pass on the changed files, and pydocstyle passes on the changed source file.

TimeSkipper's client interceptor only set time_skipping_config in
start_workflow(), so workflows started with update-with-start ran
without time skipping.
Comment thread temporalio/testing/_timeskipping.py
GregoryTravis
GregoryTravis previously approved these changes Oct 26, 2026
@tconley1428

Copy link
Copy Markdown
Contributor

Needs a changelog fragment to detail the change for a user.

@GregoryTravis
GregoryTravis dismissed their stale review October 26, 2026 17:59

Needs changelog fragment

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants