Repository navigation
feature-pre-release: new time skipping for workflows and schedules - #1246
feiyang3cat wants to merge 6 commits into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
This PR depends on
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ebca3a6d9f
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if errors.Is(ctx.Err(), context.DeadlineExceeded) { | ||
| cctx.Printer.Println("poll timed out") | ||
| return nil |
There was a problem hiding this comment.
Preserve global command-timeout failures
When --command-timeout expires before the poll-specific --timeout (or when --timeout is omitted), ctx inherits context.DeadlineExceeded from cctx, so this branch treats the global command failure as a normal poll timeout and returns nil. The CLI therefore exits successfully and discards the descriptive command timed out after ... cause; check whether cctx itself expired and propagate its cause before handling the child poll timeout.
Useful? React with 👍 / 👎.
ebca3a6 to
1dd4c0f
Compare
1dd4c0f to
c4691de
Compare
manual testingHappy Path: workflow time skipping(1) build both dev and server with a different name go build -o /tmp/temporal-vts ./cmd/temporal(2)Start the local server with Workflow and Schedule time skipping enabled for all Namespaces (terminal 1) Note: Schedule time skipping requires CHASM Schedules. This flag also enables CHASM creation for new Schedules. /tmp/temporal-vts server start-dev \
--namespace timeskipping-test \
--enable-time-skippingcheck webUI: http://localhost:8233/ (3)start your worker (terminal-2) (4) start workflow first without time skipping (terimnal-3) and check in webUI /tmp/temporal-vts workflow start \
--namespace timeskipping-test \
--workflow-id vts-workflow-1 \
--type TimerWorkflow \
--task-queue vts-test-queue(5) (option-1) start time skipping to run the workflow to completion(terimnal-3) and check in webUI to find time is skipped and workflow runs to completion /tmp/temporal-vts workflow time-skipping enable \
--namespace timeskipping-test \
--workflow-id vts-workflow-1 \(5)(option-2) start time skipping with a shorter fast-forward if you want your time skipping stop somewhere (terimnal-3) and check in webUI /tmp/temporal-vts workflow time-skipping enable \
--namespace timeskipping-test \
--workflow-id vts-workflow-1 \
--fast-forward-duration 5h \
--fast-forward-id manual-wf-ff-1 \
/tmp/temporal-vts workflow time-skipping poll \
--namespace timeskipping-test \
--workflow-id vts-workflow-1 \
--fast-forward-id manual-wf-ff-1check in details of the event WorkflowExecutionTimeSkippingTransitioned to see 5 hours move forward {
"eventId": "7",
"eventTime": "2026-10-27T20:19:27.266214Z",
"eventType": "WorkflowExecutionTimeSkippingTransitioned",
"taskId": "1048603",
"workerMayIgnore": true,
"workflowExecutionTimeSkippingTransitionedEventAttributes": {
"targetTime": "2026-10-28T01:19:27.266156Z",
"disabledAfterFastForward": true,
"wallClockTime": "2026-10-27T20:19:27.266214Z"
},
"links": [],
"billableActions": 0
}Happy Path: schedule time skipping
Error caseSchedule enable requires a fast-forward duration: /tmp/temporal-vts schedule time-skipping enable \
--namespace YourNamespace \
--schedule-id YourScheduleId
echo $?Expected error and exit code: Workflow enable rejects a fast-forward ID without a duration: /tmp/temporal-vts workflow time-skipping enable \
--namespace YourNamespace \
--workflow-id YourWorkflowId \
--fast-forward-id YourWorkflowFastForwardId
echo $?Expected error and exit code: CompositionStart another Workflow to test a partial fast-forward: /tmp/temporal-vts workflow start \
--namespace YourNamespace \
--workflow-id YourPartialWorkflowId \
--type TimerWorkflow \
--task-queue YourTaskQueue
/tmp/temporal-vts workflow time-skipping enable \
--namespace YourNamespace \
--workflow-id YourPartialWorkflowId \
--fast-forward-duration 5hCopy the generated fast-forward ID from the output and use it as /tmp/temporal-vts workflow time-skipping poll \
--namespace YourNamespace \
--workflow-id YourPartialWorkflowId \
--fast-forward-id YourFastForwardIdExpected output: This means the five-hour fast-forward completed. The Workflow’s ten-hour timer should still be pending. Inspect the effective configuration and fast-forward status: /tmp/temporal-vts workflow describe \
--namespace YourNamespace \
--workflow-id YourPartialWorkflowIdIn the Web UI at http://localhost:8233/, select Disable time skipping and describe again: /tmp/temporal-vts workflow time-skipping disable \
--namespace YourNamespace \
--workflow-id YourPartialWorkflowId
/tmp/temporal-vts workflow describe \
--namespace YourNamespace \
--workflow-id YourPartialWorkflowIdConfirm that For the Schedule created in the happy-path test, inspect its status, then disable time skipping: /tmp/temporal-vts schedule describe \
--namespace YourNamespace \
--schedule-id YourScheduleId
/tmp/temporal-vts schedule time-skipping disable \
--namespace YourNamespace \
--schedule-id YourScheduleId
/tmp/temporal-vts schedule describe \
--namespace YourNamespace \
--schedule-id YourScheduleIdConfirm that |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f190d21f0e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if reason == "" { | ||
| cctx.Printer.Println(status) | ||
| } else { | ||
| cctx.Printer.Printlnf("%s: %s", status, reason) |
There was a problem hiding this comment.
Emit structured poll results for JSON output
When either time-skipping poll command is invoked with --output json or --output jsonl, Printer.Println and Printlnf intentionally discard their arguments, so the command succeeds with empty stdout instead of reporting completed, poll timed out, or failed. The Schedule poll has the same issue in commands.schedule.go:699,707-709,716; emit the status and reason through PrintStructured when JSON output is selected.
Useful? React with 👍 / 👎.
8d1ae22 to
2f14e42
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2f14e42094
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if cctx.JSONOutput { | ||
| return nil |
There was a problem hiding this comment.
Return generated fast-forward IDs for JSON output
When either enable command is run with --output json/jsonl and no --fast-forward-id, the CLI generates an ID but suppresses all output here (and likewise in printScheduleTimeSkippingResult), so callers cannot obtain the ID required by the corresponding poll command without making an additional describe request. Emit a structured update result containing at least the generated fast-forward ID instead of returning empty output.
Useful? React with 👍 / 👎.
0d5818e to
cf312a5
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cf312a5a97
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| case enumspb.FAST_FORWARD_POLLING_RESULT_FAST_FORWARD_FAILED: | ||
| return "failed", resp.GetFailedReason(), nil |
There was a problem hiding this comment.
Fail the command when the fast-forward fails
When the server returns FAST_FORWARD_POLLING_RESULT_FAST_FORWARD_FAILED, this helper returns a nil error, so the caller prints failed: ... and exits successfully. Automation invoking the poll command therefore cannot distinguish a failed fast-forward from a successful one by exit status; the Schedule poll has the same behavior in commands.schedule.go when status != "pending". Return an error for terminal failures after emitting the result, consistent with other result commands such as Workflow Update and Activity result.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
this is business logic failure not program failure
cf312a5 to
88c1554
Compare
| StartDelay: opts.StartDelay.Duration(), | ||
| Summary: opts.StaticSummary, | ||
| Details: opts.StaticDetails, | ||
| StaticDetails: opts.StaticDetails, |
There was a problem hiding this comment.
due to SDK version bump
faf0adb to
66ce2f0
Compare
| return patchScheduleTimeSkipping(cctx, c.Parent.Parent, c.ScheduleId, config) | ||
| } | ||
|
|
||
| // TODO: need to change to SDK polling. |
There was a problem hiding this comment.
waiting for SDK poll api
470a6f5 to
f87c320
Compare
d184b9f to
90eb7d5
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 90eb7d5062
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
90eb7d5 to
fd2148b
Compare
| --namespace YourNamespace \ | ||
| --workflow-id YourWorkflowId \ | ||
| --fast-forward-duration 5h | ||
| ``` |
There was a problem hiding this comment.
| ``` | |
| ``` | |
| Once enabled, the workflow execution clock fast-forwards during inactivity, expediting the completion of timers, retry waits, and start delays. |
| - name: temporal workflow time-skipping | ||
| summary: Manage Workflow time skipping (Experimental) | ||
| description: | | ||
| Manage Workflow time skipping. |
There was a problem hiding this comment.
| Manage Workflow time skipping. | |
| Manage Workflow time skipping, where a workflow's virtual clock fast-forwards when idle. Use time skipping in testing environments to efficiently evaluate the behavior of a workflow with extended periods of inactivity. | |
| Note: This is an experimental feature and may change in the future. |
| - name: temporal schedule time-skipping | ||
| summary: Manage Schedule time skipping (Experimental) | ||
| description: | | ||
| Manage Schedule time skipping. |
There was a problem hiding this comment.
| Manage Schedule time skipping. | |
| Manage Schedule time skipping, where a schedule's virtual clock fast-forwards when idle. Use time skipping in testing environments to efficiently evaluate the behavior of a schedule. | |
| Note: This is an experimental feature and may change in the future. |
What changed?
temporal schedule time-skipping enable,disable, andpoll.temporal workflow time-skipping enable,disable, andpoll.--enable-time-skipping(for all namespaces) server flag to enable time skipping for both workflows and schedules, and new chasm schedule will also be enabledChecklist
Stability
-o json/-o jsonl) are treated as breaking changesDesign
temporal <noun> <verb>structure (e.g.temporal workflow start) (similar totemporal workflow update actionthe commands usetemporal workflow time-skipping <verb>andtemporal schedule time-skipping <verb>. The final segment is the action.)--search-attribute, bad:--index-field)(Experimental)incommands.yamlHelp text (see style guide at the top of
commands.yaml)--namespace, not-n), one flag per lineYourXxxform (YourWorkflowId,YourNamespace)Behavior
Tests
SharedServerSuite)func TestXxx) where applicableManual Testing
too long, added in comments