Skip to content

Commit

Permalink
Set task queue name in DescribeWorkflowExecutionResponse (#2455)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexshtin authored Feb 3, 2022
1 parent d2d1e3d commit 4d41efc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
9 changes: 5 additions & 4 deletions host/describe_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import (
func (s *integrationSuite) TestDescribeWorkflowExecution() {
id := "integration-describe-wfe-test"
wt := "integration-describe-wfe-test-type"
tl := "integration-describe-wfe-test-taskqueue"
tq := "integration-describe-wfe-test-taskqueue"
identity := "worker1"

// Start workflow execution
Expand All @@ -55,7 +55,7 @@ func (s *integrationSuite) TestDescribeWorkflowExecution() {
Namespace: s.namespace,
WorkflowId: id,
WorkflowType: &commonpb.WorkflowType{Name: wt},
TaskQueue: &taskqueuepb.TaskQueue{Name: tl},
TaskQueue: &taskqueuepb.TaskQueue{Name: tq},
Input: nil,
WorkflowRunTimeout: timestamp.DurationPtr(100 * time.Second),
WorkflowTaskTimeout: timestamp.DurationPtr(1 * time.Second),
Expand All @@ -81,6 +81,7 @@ func (s *integrationSuite) TestDescribeWorkflowExecution() {
s.Nil(dweResponse.WorkflowExecutionInfo.CloseTime)
s.Equal(int64(2), dweResponse.WorkflowExecutionInfo.HistoryLength) // WorkflowStarted, WorkflowTaskScheduled
s.Equal(dweResponse.WorkflowExecutionInfo.GetStartTime(), dweResponse.WorkflowExecutionInfo.GetExecutionTime())
s.Equal(tq, dweResponse.WorkflowExecutionInfo.TaskQueue)

// workflow logic
workflowComplete := false
Expand All @@ -96,7 +97,7 @@ func (s *integrationSuite) TestDescribeWorkflowExecution() {
Attributes: &commandpb.Command_ScheduleActivityTaskCommandAttributes{ScheduleActivityTaskCommandAttributes: &commandpb.ScheduleActivityTaskCommandAttributes{
ActivityId: "1",
ActivityType: &commonpb.ActivityType{Name: "test-activity-type"},
TaskQueue: &taskqueuepb.TaskQueue{Name: tl},
TaskQueue: &taskqueuepb.TaskQueue{Name: tq},
Input: payloads.EncodeString("test-input"),
ScheduleToCloseTimeout: timestamp.DurationPtr(100 * time.Second),
ScheduleToStartTimeout: timestamp.DurationPtr(2 * time.Second),
Expand All @@ -123,7 +124,7 @@ func (s *integrationSuite) TestDescribeWorkflowExecution() {
poller := &TaskPoller{
Engine: s.engine,
Namespace: s.namespace,
TaskQueue: &taskqueuepb.TaskQueue{Name: tl},
TaskQueue: &taskqueuepb.TaskQueue{Name: tq},
Identity: identity,
WorkflowTaskHandler: wtHandler,
ActivityTaskHandler: atHandler,
Expand Down
7 changes: 4 additions & 3 deletions service/history/historyEngine.go
Original file line number Diff line number Diff line change
Expand Up @@ -1196,12 +1196,13 @@ func (e *historyEngineImpl) DescribeWorkflowExecution(
},
Type: &commonpb.WorkflowType{Name: executionInfo.WorkflowTypeName},
StartTime: executionInfo.StartTime,
ExecutionTime: executionInfo.ExecutionTime,
Status: executionState.Status,
HistoryLength: mutableState.GetNextEventID() - common.FirstEventID,
AutoResetPoints: executionInfo.AutoResetPoints,
ExecutionTime: executionInfo.ExecutionTime,
Memo: &commonpb.Memo{Fields: executionInfo.Memo},
SearchAttributes: &commonpb.SearchAttributes{IndexedFields: executionInfo.SearchAttributes},
Status: executionState.Status,
AutoResetPoints: executionInfo.AutoResetPoints,
TaskQueue: executionInfo.TaskQueue,
StateTransitionCount: executionInfo.StateTransitionCount,
},
}
Expand Down

0 comments on commit 4d41efc

Please sign in to comment.