diff --git a/temporalio/.tool-versions b/temporalio/.tool-versions deleted file mode 100644 index 9f00cc14..00000000 --- a/temporalio/.tool-versions +++ /dev/null @@ -1 +0,0 @@ -ruby 3.3.7 diff --git a/temporalio/lib/temporalio/internal/worker/workflow_instance.rb b/temporalio/lib/temporalio/internal/worker/workflow_instance.rb index 0fb5399b..abce7c91 100644 --- a/temporalio/lib/temporalio/internal/worker/workflow_instance.rb +++ b/temporalio/lib/temporalio/internal/worker/workflow_instance.rb @@ -149,7 +149,7 @@ def initialize(details) end, run_id: details.initial_activation.run_id, run_timeout: ProtoUtils.duration_to_seconds(@init_job.workflow_run_timeout), - start_time: ProtoUtils.timestamp_to_time(details.initial_activation.timestamp) || raise, + start_time: ProtoUtils.timestamp_to_time(@init_job.start_time) || raise, task_queue: details.task_queue, task_timeout: ProtoUtils.duration_to_seconds(@init_job.workflow_task_timeout) || raise, workflow_id: @init_job.workflow_id, diff --git a/temporalio/lib/temporalio/workflow/info.rb b/temporalio/lib/temporalio/workflow/info.rb index ea68caa5..2bc7a29f 100644 --- a/temporalio/lib/temporalio/workflow/info.rb +++ b/temporalio/lib/temporalio/workflow/info.rb @@ -54,7 +54,7 @@ module Workflow # @!attribute run_timeout # @return [Float, nil] Run timeout for the workflow. # @!attribute start_time - # @return [Time] Time when the workflow started. + # @return [Time] Time when the workflow started on the server. # @!attribute task_queue # @return [String] Task queue for the workflow. # @!attribute task_timeout diff --git a/temporalio/test/worker_workflow_test.rb b/temporalio/test/worker_workflow_test.rb index f24a25f9..487806b4 100644 --- a/temporalio/test/worker_workflow_test.rb +++ b/temporalio/test/worker_workflow_test.rb @@ -144,6 +144,7 @@ def execute Temporalio::Workflow.info.to_h.tap do |h| h['parent'] = Temporalio::Workflow.info.parent.to_h if Temporalio::Workflow.info.parent h['root'] = Temporalio::Workflow.info.root.to_h if Temporalio::Workflow.info.root + h['start_time'] = Temporalio::Workflow.info.start_time.to_s end end end @@ -158,6 +159,7 @@ def test_info # Normal info execute_workflow(InfoWorkflow) do |handle, worker| info = handle.result #: Hash[String, untyped] + desc = handle.describe assert_equal 1, info['attempt'] assert_nil info.fetch('continued_run_id') assert_nil info.fetch('cron_schedule') @@ -170,7 +172,7 @@ def test_info assert_nil info.fetch('root') assert_equal handle.result_run_id, info['run_id'] assert_nil info.fetch('run_timeout') - refute_nil info['start_time'] + assert_equal desc.start_time.to_s, info['start_time'] assert_equal worker.task_queue, info['task_queue'] assert_equal 10.0, info['task_timeout'] assert_equal handle.id, info['workflow_id']