diff --git a/tests/activity_api_pause_test.go b/tests/activity_api_pause_test.go index 9b37dcd2e9c..2fba6b8f672 100644 --- a/tests/activity_api_pause_test.go +++ b/tests/activity_api_pause_test.go @@ -37,7 +37,6 @@ import ( "go.temporal.io/sdk/temporal" "go.temporal.io/sdk/workflow" "go.temporal.io/server/common/dynamicconfig" - "go.temporal.io/server/common/namespace" "go.temporal.io/server/common/testing/testvars" "go.temporal.io/server/common/util" "go.temporal.io/server/tests/testcore" @@ -56,7 +55,7 @@ type ActivityApiPauseClientTestSuite struct { func (s *ActivityApiPauseClientTestSuite) SetupSuite() { s.ClientFunctionalSuite.SetupSuite() s.OverrideDynamicConfig(dynamicconfig.ActivityAPIsEnabled, true) - s.tv = testvars.New(s.T()).WithTaskQueue(s.TaskQueue()).WithNamespaceName(namespace.Name(s.Namespace())) + s.tv = testvars.New(s.T()).WithTaskQueue(s.TaskQueue()).WithNamespaceName(s.Namespace()) } func (s *ActivityApiPauseClientTestSuite) SetupTest() { @@ -134,7 +133,7 @@ func (s *ActivityApiPauseClientTestSuite) TestActivityPauseApi_WhileRunning() { // pause activity pauseRequest := &workflowservice.PauseActivityByIdRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: workflowRun.GetID(), ActivityId: "activity-id", } @@ -162,7 +161,7 @@ func (s *ActivityApiPauseClientTestSuite) TestActivityPauseApi_WhileRunning() { // unpause the activity unpauseRequest := &workflowservice.UnpauseActivityByIdRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: workflowRun.GetID(), ActivityId: "activity-id", Operation: &workflowservice.UnpauseActivityByIdRequest_Resume{ @@ -230,7 +229,7 @@ func (s *ActivityApiPauseClientTestSuite) TestActivityPauseApi_WhileWaiting() { // pause activity pauseRequest := &workflowservice.PauseActivityByIdRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: workflowRun.GetID(), ActivityId: "activity-id", } @@ -250,7 +249,7 @@ func (s *ActivityApiPauseClientTestSuite) TestActivityPauseApi_WhileWaiting() { // unpause the activity unpauseRequest := &workflowservice.UnpauseActivityByIdRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: workflowRun.GetID(), ActivityId: "activity-id", Operation: &workflowservice.UnpauseActivityByIdRequest_Resume{ @@ -322,7 +321,7 @@ func (s *ActivityApiPauseClientTestSuite) TestActivityPauseApi_WhileRetryNoWait( // pause activity pauseRequest := &workflowservice.PauseActivityByIdRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: workflowRun.GetID(), ActivityId: "activity-id", } @@ -332,7 +331,7 @@ func (s *ActivityApiPauseClientTestSuite) TestActivityPauseApi_WhileRetryNoWait( // unpause the activity, and set noWait flag unpauseRequest := &workflowservice.UnpauseActivityByIdRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: workflowRun.GetID(), ActivityId: "activity-id", Operation: &workflowservice.UnpauseActivityByIdRequest_Resume{ @@ -405,7 +404,7 @@ func (s *ActivityApiPauseClientTestSuite) TestActivityPauseApi_WithReset() { // pause activity pauseRequest := &workflowservice.PauseActivityByIdRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: workflowRun.GetID(), ActivityId: "activity-id", } @@ -427,7 +426,7 @@ func (s *ActivityApiPauseClientTestSuite) TestActivityPauseApi_WithReset() { // unpause the activity with reset, and set noWait flag unpauseRequest := &workflowservice.UnpauseActivityByIdRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: workflowRun.GetID(), ActivityId: "activity-id", Operation: &workflowservice.UnpauseActivityByIdRequest_Reset_{ diff --git a/tests/activity_api_reset_test.go b/tests/activity_api_reset_test.go index 670f84d9a61..719f4f8569a 100644 --- a/tests/activity_api_reset_test.go +++ b/tests/activity_api_reset_test.go @@ -39,7 +39,6 @@ import ( "go.temporal.io/sdk/temporal" "go.temporal.io/sdk/workflow" "go.temporal.io/server/common/dynamicconfig" - "go.temporal.io/server/common/namespace" "go.temporal.io/server/common/testing/testvars" "go.temporal.io/server/common/util" "go.temporal.io/server/tests/testcore" @@ -58,7 +57,7 @@ type ActivityApiResetClientTestSuite struct { func (s *ActivityApiResetClientTestSuite) SetupSuite() { s.ClientFunctionalSuite.SetupSuite() s.OverrideDynamicConfig(dynamicconfig.ActivityAPIsEnabled, true) - s.tv = testvars.New(s.T()).WithTaskQueue(s.TaskQueue()).WithNamespaceName(namespace.Name(s.Namespace())) + s.tv = testvars.New(s.T()).WithTaskQueue(s.TaskQueue()).WithNamespaceName(s.Namespace()) } func (s *ActivityApiResetClientTestSuite) SetupTest() { @@ -138,7 +137,7 @@ func (s *ActivityApiResetClientTestSuite) TestActivityResetApi_AfterRetry() { }, 5*time.Second, 200*time.Millisecond) resetRequest := &workflowservice.ResetActivityByIdRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: workflowRun.GetID(), ActivityId: "activity-id", NoWait: true, @@ -214,7 +213,7 @@ func (s *ActivityApiResetClientTestSuite) TestActivityResetApi_WithRunningAndNoW activityAboutToReset.Store(true) resetRequest := &workflowservice.ResetActivityByIdRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: workflowRun.GetID(), ActivityId: "activity-id", NoWait: true, @@ -299,7 +298,7 @@ func (s *ActivityApiResetClientTestSuite) TestActivityResetApi_InRetry() { }, 5*time.Second, 200*time.Millisecond) resetRequest := &workflowservice.ResetActivityByIdRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: workflowRun.GetID(), ActivityId: "activity-id", NoWait: true, diff --git a/tests/activity_api_update_test.go b/tests/activity_api_update_test.go index 4f4b5fce2e1..6bee1ec7081 100644 --- a/tests/activity_api_update_test.go +++ b/tests/activity_api_update_test.go @@ -41,7 +41,6 @@ import ( "go.temporal.io/sdk/temporal" "go.temporal.io/sdk/workflow" "go.temporal.io/server/common/dynamicconfig" - "go.temporal.io/server/common/namespace" "go.temporal.io/server/common/testing/testvars" "go.temporal.io/server/tests/testcore" "google.golang.org/protobuf/types/known/durationpb" @@ -56,7 +55,7 @@ type ActivityApiUpdateClientTestSuite struct { func (s *ActivityApiUpdateClientTestSuite) SetupSuite() { s.ClientFunctionalSuite.SetupSuite() s.OverrideDynamicConfig(dynamicconfig.ActivityAPIsEnabled, true) - s.tv = testvars.New(s.T()).WithTaskQueue(s.TaskQueue()).WithNamespaceName(namespace.Name(s.Namespace())) + s.tv = testvars.New(s.T()).WithTaskQueue(s.TaskQueue()).WithNamespaceName(s.Namespace()) } func (s *ActivityApiUpdateClientTestSuite) SetupTest() { @@ -141,7 +140,7 @@ func (s *ActivityApiUpdateClientTestSuite) TestActivityUpdateApi_ChangeRetryInte }, 10*time.Second, 500*time.Millisecond) updateRequest := &workflowservice.UpdateActivityOptionsByIdRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: workflowRun.GetID(), ActivityId: "activity-id", ActivityOptions: &activitypb.ActivityOptions{ @@ -219,7 +218,7 @@ func (s *ActivityApiUpdateClientTestSuite) TestActivityUpdateApi_ChangeScheduleT // update schedule_to_close_timeout updateRequest := &workflowservice.UpdateActivityOptionsByIdRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: workflowRun.GetID(), ActivityId: "activity-id", ActivityOptions: &activitypb.ActivityOptions{ @@ -298,7 +297,7 @@ func (s *ActivityApiUpdateClientTestSuite) TestActivityUpdateApi_ChangeScheduleT // also update retry policy interval, make it shorter newScheduleToCloseTimeout := 10 * time.Second updateRequest := &workflowservice.UpdateActivityOptionsByIdRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: workflowRun.GetID(), ActivityId: "activity-id", ActivityOptions: &activitypb.ActivityOptions{ diff --git a/tests/activity_test.go b/tests/activity_test.go index 421a4a20ece..0b20f424ad4 100644 --- a/tests/activity_test.go +++ b/tests/activity_test.go @@ -393,7 +393,7 @@ func (s *ActivityTestSuite) TestActivityHeartBeatWorkflow_Success() { request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -451,7 +451,7 @@ func (s *ActivityTestSuite) TestActivityHeartBeatWorkflow_Success() { for i := 0; i < 10; i++ { s.Logger.Info("Heartbeating for activity", tag.WorkflowActivityID(task.ActivityId), tag.Counter(i)) _, err := s.FrontendClient().RecordActivityTaskHeartbeat(testcore.NewContext(), &workflowservice.RecordActivityTaskHeartbeatRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskToken: task.TaskToken, Details: payloads.EncodeString("details"), }) @@ -464,7 +464,7 @@ func (s *ActivityTestSuite) TestActivityHeartBeatWorkflow_Success() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -488,7 +488,7 @@ func (s *ActivityTestSuite) TestActivityHeartBeatWorkflow_Success() { s.Equal(1, activityExecutedCount) // go over history and verify that the activity task scheduled event has header on it - events := s.GetHistory(s.Namespace(), &commonpb.WorkflowExecution{ + events := s.GetHistory(s.Namespace().String(), &commonpb.WorkflowExecution{ WorkflowId: id, RunId: we.GetRunId(), }) @@ -514,7 +514,7 @@ func (s *ActivityTestSuite) TestActivityRetry() { timeoutActivityName := "timeout_activity" request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: tv.WorkflowID(), WorkflowType: tv.WorkflowType(), TaskQueue: tv.TaskQueue(), @@ -624,7 +624,7 @@ func (s *ActivityTestSuite) TestActivityRetry() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tv.TaskQueue(), Identity: tv.WorkerIdentity(), WorkflowTaskHandler: wtHandler, @@ -635,7 +635,7 @@ func (s *ActivityTestSuite) TestActivityRetry() { describeWorkflowExecution := func() (*workflowservice.DescribeWorkflowExecutionResponse, error) { return s.FrontendClient().DescribeWorkflowExecution(testcore.NewContext(), &workflowservice.DescribeWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: &commonpb.WorkflowExecution{ WorkflowId: tv.WorkflowID(), RunId: we.RunId, @@ -686,7 +686,7 @@ func (s *ActivityTestSuite) TestActivityRetry() { s.Logger.Info("Processing workflow task:", tag.Counter(i)) _, err := poller.PollAndProcessWorkflowTask(testcore.WithRetries(1)) if err != nil { - s.PrintHistoryEvents(s.GetHistory(s.Namespace(), &commonpb.WorkflowExecution{ + s.PrintHistoryEvents(s.GetHistory(s.Namespace().String(), &commonpb.WorkflowExecution{ WorkflowId: tv.WorkflowID(), RunId: we.GetRunId(), })) @@ -714,7 +714,7 @@ func (s *ActivityTestSuite) TestActivityRetry_Infinite() { request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -782,7 +782,7 @@ func (s *ActivityTestSuite) TestActivityRetry_Infinite() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -817,7 +817,7 @@ func (s *ActivityTestSuite) TestActivityHeartBeatWorkflow_Timeout() { request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -881,7 +881,7 @@ func (s *ActivityTestSuite) TestActivityHeartBeatWorkflow_Timeout() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -919,7 +919,7 @@ func (s *ActivityTestSuite) TestTryActivityCancellationFromWorkflow() { request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -988,7 +988,7 @@ func (s *ActivityTestSuite) TestTryActivityCancellationFromWorkflow() { s.Logger.Info("Heartbeating for activity", tag.WorkflowActivityID(task.ActivityId), tag.Counter(i)) response, err := s.FrontendClient().RecordActivityTaskHeartbeat(testcore.NewContext(), &workflowservice.RecordActivityTaskHeartbeatRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskToken: task.TaskToken, Details: payloads.EncodeString("details"), }) @@ -1004,7 +1004,7 @@ func (s *ActivityTestSuite) TestTryActivityCancellationFromWorkflow() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -1021,7 +1021,7 @@ func (s *ActivityTestSuite) TestTryActivityCancellationFromWorkflow() { s.Logger.Info("Trying to cancel the task in a different thread") // Send signal so that worker can send an activity cancel _, err1 := s.FrontendClient().SignalWorkflowExecution(testcore.NewContext(), &workflowservice.SignalWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: &commonpb.WorkflowExecution{ WorkflowId: id, RunId: we.RunId, @@ -1062,7 +1062,7 @@ func (s *ActivityTestSuite) TestActivityCancellationNotStarted() { request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -1131,7 +1131,7 @@ func (s *ActivityTestSuite) TestActivityCancellationNotStarted() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -1147,7 +1147,7 @@ func (s *ActivityTestSuite) TestActivityCancellationNotStarted() { signalName := "my signal" signalInput := payloads.EncodeString("my signal input") _, err = s.FrontendClient().SignalWorkflowExecution(testcore.NewContext(), &workflowservice.SignalWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: &commonpb.WorkflowExecution{ WorkflowId: id, RunId: we.RunId, @@ -1253,7 +1253,7 @@ func (s *ActivityClientTestSuite) TestActivityHeartbeatDetailsDuringRetry() { describeWorkflowExecution := func() (*workflowservice.DescribeWorkflowExecutionResponse, error) { return s.FrontendClient().DescribeWorkflowExecution(ctx, &workflowservice.DescribeWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: &commonpb.WorkflowExecution{ WorkflowId: wfId, RunId: runId, @@ -1299,7 +1299,7 @@ func (s *ActivityTestSuite) TestActivityHeartBeat_RecordIdentity() { request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: &commonpb.WorkflowType{Name: "functional-heartbeat-identity-record-type"}, TaskQueue: taskQueue, @@ -1352,7 +1352,7 @@ func (s *ActivityTestSuite) TestActivityHeartBeat_RecordIdentity() { activityStartedSignal <- true // signal the start of activity task. <-heartbeatSignalChan // wait for signal before sending heartbeat. _, err := s.FrontendClient().RecordActivityTaskHeartbeat(testcore.NewContext(), &workflowservice.RecordActivityTaskHeartbeatRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskToken: task.TaskToken, Details: payloads.EncodeString("details"), Identity: workerIdentity, // explicitly set the worker identity in the heartbeat request @@ -1366,7 +1366,7 @@ func (s *ActivityTestSuite) TestActivityHeartBeat_RecordIdentity() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: "", // Do not send the worker identity. WorkflowTaskHandler: wtHandler, @@ -1387,7 +1387,7 @@ func (s *ActivityTestSuite) TestActivityHeartBeat_RecordIdentity() { describeWorkflowExecution := func() (*workflowservice.DescribeWorkflowExecutionResponse, error) { return s.FrontendClient().DescribeWorkflowExecution(testcore.NewContext(), &workflowservice.DescribeWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: &commonpb.WorkflowExecution{ WorkflowId: id, RunId: we.RunId, @@ -1421,7 +1421,7 @@ func (s *ActivityTestSuite) TestActivityHeartBeat_RecordIdentity() { func (s *ActivityTestSuite) TestActivityTaskCompleteForceCompletion() { sdkClient, err := sdkclient.Dial(sdkclient.Options{ HostPort: s.FrontendGRPCAddress(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), }) s.NoError(err) @@ -1448,7 +1448,7 @@ func (s *ActivityTestSuite) TestActivityTaskCompleteForceCompletion() { 10*time.Second, 500*time.Millisecond) - err = sdkClient.CompleteActivityByID(ctx, s.Namespace(), run.GetID(), run.GetRunID(), ai.ActivityID, nil, nil) + err = sdkClient.CompleteActivityByID(ctx, s.Namespace().String(), run.GetID(), run.GetRunID(), ai.ActivityID, nil, nil) s.NoError(err) // Ensure the activity is completed and the workflow is unblcked. @@ -1458,7 +1458,7 @@ func (s *ActivityTestSuite) TestActivityTaskCompleteForceCompletion() { func (s *ActivityTestSuite) TestActivityTaskCompleteRejectCompletion() { sdkClient, err := sdkclient.Dial(sdkclient.Options{ HostPort: s.FrontendGRPCAddress(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), }) s.NoError(err) diff --git a/tests/add_tasks_test.go b/tests/add_tasks_test.go index b0d3c793f20..4ef854f80ed 100644 --- a/tests/add_tasks_test.go +++ b/tests/add_tasks_test.go @@ -282,7 +282,7 @@ func (s *AddTasksSuite) TestAddTasks_GetEngineErr() { func (s *AddTasksSuite) newSDKClient() sdkclient.Client { client, err := sdkclient.Dial(sdkclient.Options{ HostPort: s.FrontendGRPCAddress(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), }) s.NoError(err) return client diff --git a/tests/admin_test.go b/tests/admin_test.go index 917b4bf2c91..36a749525c9 100644 --- a/tests/admin_test.go +++ b/tests/admin_test.go @@ -90,7 +90,7 @@ func (s *AdminTestSuite) TestAdminRebuildMutableState() { var response1 *adminservice.DescribeMutableStateResponse for { response1, err = s.AdminClient().DescribeMutableState(ctx, &adminservice.DescribeMutableStateRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: &commonpb.WorkflowExecution{ WorkflowId: workflowID, RunId: runID, @@ -104,7 +104,7 @@ func (s *AdminTestSuite) TestAdminRebuildMutableState() { } _, err = s.AdminClient().RebuildMutableState(ctx, &adminservice.RebuildMutableStateRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: &commonpb.WorkflowExecution{ WorkflowId: workflowID, RunId: runID, @@ -113,7 +113,7 @@ func (s *AdminTestSuite) TestAdminRebuildMutableState() { s.NoError(err) response2, err := s.AdminClient().DescribeMutableState(ctx, &adminservice.DescribeMutableStateRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: &commonpb.WorkflowExecution{ WorkflowId: workflowID, RunId: runID, diff --git a/tests/advanced_visibility_test.go b/tests/advanced_visibility_test.go index e3e2b649cb5..d6e53c52398 100644 --- a/tests/advanced_visibility_test.go +++ b/tests/advanced_visibility_test.go @@ -128,7 +128,7 @@ func (s *AdvancedVisibilitySuite) SetupSuite() { sdkClient, err := sdkclient.Dial(sdkclient.Options{ HostPort: s.FrontendGRPCAddress(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), }) if err != nil { s.Logger.Fatal("Error when creating SDK client", tag.Error(err)) @@ -184,7 +184,7 @@ func (s *AdvancedVisibilitySuite) TestListOpenWorkflow() { for i := 0; i < numOfRetry; i++ { startFilter.LatestTime = timestamppb.New(time.Now().UTC()) resp, err := s.FrontendClient().ListOpenWorkflowExecutions(testcore.NewContext(), &workflowservice.ListOpenWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), MaximumPageSize: testcore.DefaultPageSize, StartTimeFilter: startFilter, Filters: &workflowservice.ListOpenWorkflowExecutionsRequest_ExecutionFilter{ExecutionFilter: &filterpb.WorkflowExecutionFilter{ @@ -299,7 +299,7 @@ func (s *AdvancedVisibilitySuite) TestListWorkflow_SearchAttribute() { taskQueue := &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL} poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, StickyTaskQueue: taskQueue, Identity: "worker1", @@ -321,7 +321,7 @@ func (s *AdvancedVisibilitySuite) TestListWorkflow_SearchAttribute() { time.Sleep(testcore.WaitForESToSettle) //nolint:forbidigo listRequest := &workflowservice.ListWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), PageSize: int32(2), Query: fmt.Sprintf(`WorkflowType = '%s' and ExecutionStatus = 'Running' and BinaryChecksums = 'binary-v1'`, wt), } @@ -330,7 +330,7 @@ func (s *AdvancedVisibilitySuite) TestListWorkflow_SearchAttribute() { // verify DescribeWorkflowExecution descRequest := &workflowservice.DescribeWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: &commonpb.WorkflowExecution{ WorkflowId: id, }, @@ -411,7 +411,7 @@ func (s *AdvancedVisibilitySuite) TestListWorkflow_OrQuery() { query1 := fmt.Sprintf(`CustomIntField = %d`, 1) var openExecution *workflowpb.WorkflowExecutionInfo listRequest := &workflowservice.ListWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), PageSize: testcore.DefaultPageSize, Query: query1, } @@ -504,7 +504,7 @@ func (s *AdvancedVisibilitySuite) TestListWorkflow_KeywordQuery() { // Exact match Keyword (supported) var openExecution *workflowpb.WorkflowExecutionInfo listRequest := &workflowservice.ListWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), PageSize: testcore.DefaultPageSize, Query: `CustomKeywordField = "justice for all"`, } @@ -528,7 +528,7 @@ func (s *AdvancedVisibilitySuite) TestListWorkflow_KeywordQuery() { // Partial match on Keyword (not supported) listRequest = &workflowservice.ListWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), PageSize: testcore.DefaultPageSize, Query: `CustomKeywordField = "justice"`, } @@ -538,7 +538,7 @@ func (s *AdvancedVisibilitySuite) TestListWorkflow_KeywordQuery() { // Inordered match on Keyword (not supported) listRequest = &workflowservice.ListWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), PageSize: testcore.DefaultPageSize, Query: `CustomKeywordField = "all for justice"`, } @@ -548,7 +548,7 @@ func (s *AdvancedVisibilitySuite) TestListWorkflow_KeywordQuery() { // Prefix search listRequest = &workflowservice.ListWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), PageSize: testcore.DefaultPageSize, Query: `CustomKeywordField STARTS_WITH "justice"`, } @@ -560,7 +560,7 @@ func (s *AdvancedVisibilitySuite) TestListWorkflow_KeywordQuery() { s.ProtoEqual(searchAttr, resp.Executions[0].GetSearchAttributes()) listRequest = &workflowservice.ListWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), PageSize: testcore.DefaultPageSize, Query: fmt.Sprintf(`WorkflowId = %q AND CustomKeywordField NOT STARTS_WITH "justice"`, id), } @@ -589,7 +589,7 @@ func (s *AdvancedVisibilitySuite) TestListWorkflow_StringQuery() { // Exact match String (supported) var openExecution *workflowpb.WorkflowExecutionInfo listRequest := &workflowservice.ListWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), PageSize: testcore.DefaultPageSize, Query: `CustomTextField = "nothing else matters"`, } @@ -613,7 +613,7 @@ func (s *AdvancedVisibilitySuite) TestListWorkflow_StringQuery() { // Partial match on String (supported) listRequest = &workflowservice.ListWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), PageSize: testcore.DefaultPageSize, Query: `CustomTextField = "nothing"`, } @@ -623,7 +623,7 @@ func (s *AdvancedVisibilitySuite) TestListWorkflow_StringQuery() { // Inordered match on String (supported) listRequest = &workflowservice.ListWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), PageSize: testcore.DefaultPageSize, Query: `CustomTextField = "else nothing matters"`, } @@ -652,7 +652,7 @@ func (s *AdvancedVisibilitySuite) TestListWorkflow_MaxWindowSize() { var nextPageToken []byte listRequest := &workflowservice.ListWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), PageSize: int32(testcore.DefaultPageSize), NextPageToken: nextPageToken, Query: fmt.Sprintf(`WorkflowType = '%s' and ExecutionStatus = "Running"`, wt), @@ -732,7 +732,7 @@ func (s *AdvancedVisibilitySuite) TestListWorkflow_OrderBy() { query1 := fmt.Sprintf(queryTemplate, wt, searchattribute.CloseTime, asc) var openExecutions []*workflowpb.WorkflowExecutionInfo listRequest := &workflowservice.ListWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), PageSize: pageSize, Query: query1, } @@ -844,14 +844,14 @@ func (s *AdvancedVisibilitySuite) testListWorkflowHelper(numOfWorkflows, pageSiz var nextPageToken []byte listRequest := &workflowservice.ListWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), PageSize: int32(pageSize), NextPageToken: nextPageToken, Query: fmt.Sprintf(`WorkflowType = '%s' and ExecutionStatus = 'Running'`, wType), } scanRequest := &workflowservice.ScanWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), PageSize: int32(pageSize), NextPageToken: nextPageToken, Query: fmt.Sprintf(`WorkflowType = '%s' and ExecutionStatus = 'Running'`, wType), @@ -917,12 +917,12 @@ func (s *AdvancedVisibilitySuite) testListWorkflowHelper(numOfWorkflows, pageSiz func (s *AdvancedVisibilitySuite) testHelperForReadOnce(expectedRunID string, query string, isScan bool) { var openExecution *workflowpb.WorkflowExecutionInfo listRequest := &workflowservice.ListWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), PageSize: testcore.DefaultPageSize, Query: query, } scanRequest := &workflowservice.ScanWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), PageSize: testcore.DefaultPageSize, Query: query, } @@ -974,7 +974,7 @@ func (s *AdvancedVisibilitySuite) TestScanWorkflow() { request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -1029,7 +1029,7 @@ func (s *AdvancedVisibilitySuite) TestScanWorkflow_PageToken() { taskQueue := &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL} request := &workflowservice.StartWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowType: workflowType, TaskQueue: taskQueue, Input: nil, @@ -1063,7 +1063,7 @@ func (s *AdvancedVisibilitySuite) TestCountWorkflow() { query := fmt.Sprintf(`WorkflowId = "%s" and %s = "%s"`, id, s.testSearchAttributeKey, s.testSearchAttributeVal) countRequest := &workflowservice.CountWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Query: query, } var resp *workflowservice.CountWorkflowExecutionsResponse @@ -1100,7 +1100,7 @@ func (s *AdvancedVisibilitySuite) TestCountGroupByWorkflow() { _, err := s.FrontendClient().TerminateWorkflowExecution( testcore.NewContext(), &workflowservice.TerminateWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: &commonpb.WorkflowExecution{ WorkflowId: wfid, RunId: we.RunId, @@ -1113,7 +1113,7 @@ func (s *AdvancedVisibilitySuite) TestCountGroupByWorkflow() { query := fmt.Sprintf(`WorkflowType = %q GROUP BY ExecutionStatus`, wt) countRequest := &workflowservice.CountWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Query: query, } var resp *workflowservice.CountWorkflowExecutionsResponse @@ -1171,7 +1171,7 @@ func (s *AdvancedVisibilitySuite) createStartWorkflowExecutionRequest(id, wt, tl taskQueue := &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL} request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -1195,7 +1195,7 @@ func (s *AdvancedVisibilitySuite) TestUpsertWorkflowExecutionSearchAttributes() request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -1266,7 +1266,7 @@ func (s *AdvancedVisibilitySuite) TestUpsertWorkflowExecutionSearchAttributes() poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, StickyTaskQueue: taskQueue, Identity: identity, @@ -1298,7 +1298,7 @@ func (s *AdvancedVisibilitySuite) TestUpsertWorkflowExecutionSearchAttributes() // verify upsert data is on ES listRequest := &workflowservice.ListWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), PageSize: int32(2), Query: fmt.Sprintf(`WorkflowType = '%s' and ExecutionStatus = 'Running'`, wt), } @@ -1366,7 +1366,7 @@ func (s *AdvancedVisibilitySuite) TestUpsertWorkflowExecutionSearchAttributes() // verify search attributes are unset listRequest = &workflowservice.ListWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), PageSize: int32(2), Query: fmt.Sprintf(`WorkflowType = '%s' and ExecutionStatus = 'Running'`, wt), } @@ -1390,7 +1390,7 @@ func (s *AdvancedVisibilitySuite) TestUpsertWorkflowExecutionSearchAttributes() // verify query by unset search attribute listRequest = &workflowservice.ListWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), PageSize: int32(2), Query: fmt.Sprintf(`WorkflowType = '%s' and ExecutionStatus = 'Running' and CustomTextField is null and CustomIntField is null`, wt), } @@ -1408,7 +1408,7 @@ func (s *AdvancedVisibilitySuite) TestUpsertWorkflowExecutionSearchAttributes() // verify search attributes from DescribeWorkflowExecution descRequest := &workflowservice.DescribeWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: &commonpb.WorkflowExecution{ WorkflowId: id, }, @@ -1452,7 +1452,7 @@ func (s *AdvancedVisibilitySuite) TestUpsertWorkflowExecutionSearchAttributes() // verify search attributes from DescribeWorkflowExecution descRequest = &workflowservice.DescribeWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: &commonpb.WorkflowExecution{ WorkflowId: id, }, @@ -1486,7 +1486,7 @@ func (s *AdvancedVisibilitySuite) TestModifyWorkflowExecutionProperties() { request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -1554,7 +1554,7 @@ func (s *AdvancedVisibilitySuite) TestModifyWorkflowExecutionProperties() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, StickyTaskQueue: taskQueue, Identity: identity, @@ -1595,7 +1595,7 @@ func (s *AdvancedVisibilitySuite) TestModifyWorkflowExecutionProperties() { // verify memo data is on ES listRequest := &workflowservice.ListWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), PageSize: int32(2), Query: fmt.Sprintf(`WorkflowType = '%s' and ExecutionStatus = 'Running'`, wt), } @@ -1641,7 +1641,7 @@ func (s *AdvancedVisibilitySuite) TestModifyWorkflowExecutionProperties() { // verify memo data is on ES listRequest = &workflowservice.ListWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), PageSize: int32(2), Query: fmt.Sprintf(`WorkflowType = '%s' and ExecutionStatus = 'Running'`, wt), } @@ -1672,7 +1672,7 @@ func (s *AdvancedVisibilitySuite) TestModifyWorkflowExecutionProperties() { time.Sleep(testcore.WaitForESToSettle) //nolint:forbidigo descRequest := &workflowservice.DescribeWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: &commonpb.WorkflowExecution{ WorkflowId: id, }, @@ -1756,7 +1756,7 @@ func (s *AdvancedVisibilitySuite) TestUpsertWorkflowExecution_InvalidKey() { request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -1787,7 +1787,7 @@ func (s *AdvancedVisibilitySuite) TestUpsertWorkflowExecution_InvalidKey() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, StickyTaskQueue: taskQueue, Identity: identity, @@ -1799,7 +1799,7 @@ func (s *AdvancedVisibilitySuite) TestUpsertWorkflowExecution_InvalidKey() { _, err := poller.PollAndProcessWorkflowTask() s.Error(err) s.IsType(&serviceerror.InvalidArgument{}, err) - historyEvents := s.GetHistory(s.Namespace(), &commonpb.WorkflowExecution{ + historyEvents := s.GetHistory(s.Namespace().String(), &commonpb.WorkflowExecution{ WorkflowId: id, RunId: we.RunId, }) @@ -1811,12 +1811,12 @@ func (s *AdvancedVisibilitySuite) TestUpsertWorkflowExecution_InvalidKey() { 3 WorkflowTaskStarted 4 WorkflowTaskFailed {"Cause":23,"Failure":{"Message":"BadSearchAttributes: search attribute INVALIDKEY is not defined"}}`, historyEvents) } else { - s.ErrorContains(err, fmt.Sprintf("BadSearchAttributes: Namespace %s has no mapping defined for search attribute INVALIDKEY", s.Namespace())) + s.ErrorContains(err, fmt.Sprintf("BadSearchAttributes: Namespace %s has no mapping defined for search attribute INVALIDKEY", s.Namespace().String())) s.EqualHistoryEvents(fmt.Sprintf(` 1 WorkflowExecutionStarted 2 WorkflowTaskScheduled 3 WorkflowTaskStarted - 4 WorkflowTaskFailed {"Cause":23,"Failure":{"Message":"BadSearchAttributes: Namespace %s has no mapping defined for search attribute INVALIDKEY"}}`, s.Namespace()), historyEvents) + 4 WorkflowTaskFailed {"Cause":23,"Failure":{"Message":"BadSearchAttributes: Namespace %s has no mapping defined for search attribute INVALIDKEY"}}`, s.Namespace().String()), historyEvents) } } @@ -1862,7 +1862,7 @@ func (s *AdvancedVisibilitySuite) TestChildWorkflow_ParentWorkflow() { resp, err := s.FrontendClient().ListWorkflowExecutions( ctx, &workflowservice.ListWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Query: fmt.Sprintf("WorkflowType = %q", wfType), PageSize: testcore.DefaultPageSize, }, @@ -1887,7 +1887,7 @@ func (s *AdvancedVisibilitySuite) TestChildWorkflow_ParentWorkflow() { resp, err := s.FrontendClient().ListWorkflowExecutions( ctx, &workflowservice.ListWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Query: fmt.Sprintf("WorkflowType = %q", childWfType), PageSize: testcore.DefaultPageSize, }, @@ -1936,12 +1936,12 @@ func (s *AdvancedVisibilitySuite) Test_BuildIdIndexedOnCompletion_UnversionedWor _, err := s.FrontendClient().StartWorkflowExecution(ctx, request) s.NoError(err) - pollRequest := &workflowservice.PollWorkflowTaskQueueRequest{Namespace: s.Namespace(), TaskQueue: request.TaskQueue, Identity: id} + pollRequest := &workflowservice.PollWorkflowTaskQueueRequest{Namespace: s.Namespace().String(), TaskQueue: request.TaskQueue, Identity: id} task, err := s.FrontendClient().PollWorkflowTaskQueue(ctx, pollRequest) s.NoError(err) s.Greater(len(task.TaskToken), 0) _, err = s.FrontendClient().RespondWorkflowTaskCompleted(ctx, &workflowservice.RespondWorkflowTaskCompletedRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Identity: id, WorkerVersionStamp: &commonpb.WorkerVersionStamp{BuildId: "1.0"}, TaskToken: task.TaskToken, @@ -1954,14 +1954,14 @@ func (s *AdvancedVisibilitySuite) Test_BuildIdIndexedOnCompletion_UnversionedWor worker_versioning.UnversionedBuildIdSearchAttribute("1.0"), }, buildIDs) - _, err = s.FrontendClient().SignalWorkflowExecution(ctx, &workflowservice.SignalWorkflowExecutionRequest{Namespace: s.Namespace(), WorkflowExecution: task.WorkflowExecution, SignalName: "continue"}) + _, err = s.FrontendClient().SignalWorkflowExecution(ctx, &workflowservice.SignalWorkflowExecutionRequest{Namespace: s.Namespace().String(), WorkflowExecution: task.WorkflowExecution, SignalName: "continue"}) s.NoError(err) task, err = s.FrontendClient().PollWorkflowTaskQueue(ctx, pollRequest) s.NoError(err) s.Greater(len(task.TaskToken), 0) _, err = s.FrontendClient().RespondWorkflowTaskCompleted(ctx, &workflowservice.RespondWorkflowTaskCompletedRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Identity: id, WorkerVersionStamp: &commonpb.WorkerVersionStamp{BuildId: "1.1"}, TaskToken: task.TaskToken, @@ -1992,7 +1992,7 @@ func (s *AdvancedVisibilitySuite) Test_BuildIdIndexedOnCompletion_UnversionedWor s.Equal([]string{}, buildIDs) _, err = s.FrontendClient().RespondWorkflowTaskCompleted(ctx, &workflowservice.RespondWorkflowTaskCompletedRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Identity: id, WorkerVersionStamp: &commonpb.WorkerVersionStamp{BuildId: "1.2"}, TaskToken: task.TaskToken, @@ -2011,7 +2011,7 @@ func (s *AdvancedVisibilitySuite) Test_BuildIdIndexedOnCompletion_UnversionedWor for minor := 1; minor <= 2; minor++ { s.Eventually(func() bool { response, err := s.FrontendClient().ListWorkflowExecutions(ctx, &workflowservice.ListWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Query: fmt.Sprintf("BuildIds = '%s'", worker_versioning.UnversionedBuildIdSearchAttribute(fmt.Sprintf("1.%d", minor))), PageSize: testcore.DefaultPageSize, }) @@ -2075,7 +2075,7 @@ func (s *AdvancedVisibilitySuite) Test_BuildIdIndexedOnCompletion_VersionedWorke // Declare v1 _, err := s.FrontendClient().UpdateWorkerBuildIdCompatibility(ctx, &workflowservice.UpdateWorkerBuildIdCompatibilityRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Operation: &workflowservice.UpdateWorkerBuildIdCompatibilityRequest_AddNewBuildIdInNewDefaultSet{ AddNewBuildIdInNewDefaultSet: buildIdv1, @@ -2115,7 +2115,7 @@ func (s *AdvancedVisibilitySuite) Test_BuildIdIndexedOnCompletion_VersionedWorke // Update sets with v1.1 _, err = s.FrontendClient().UpdateWorkerBuildIdCompatibility(ctx, &workflowservice.UpdateWorkerBuildIdCompatibilityRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Operation: &workflowservice.UpdateWorkerBuildIdCompatibilityRequest_AddNewCompatibleBuildId{ AddNewCompatibleBuildId: &workflowservice.UpdateWorkerBuildIdCompatibilityRequest_AddNewCompatibleVersion{ @@ -2177,7 +2177,7 @@ func (s *AdvancedVisibilitySuite) Test_BuildIdIndexedOnCompletion_VersionedWorke // We should have 3 runs with the v1.1 search attribute: First and second run in chain, and single child s.Eventually(func() bool { response, err := s.FrontendClient().ListWorkflowExecutions(ctx, &workflowservice.ListWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Query: fmt.Sprintf("BuildIds = %q", worker_versioning.VersionedBuildIdSearchAttribute(buildIdv11)), PageSize: testcore.DefaultPageSize, }) @@ -2217,7 +2217,7 @@ func (s *AdvancedVisibilitySuite) Test_BuildIdIndexedOnReset() { // Declare v1 _, err := s.FrontendClient().UpdateWorkerBuildIdCompatibility(ctx, &workflowservice.UpdateWorkerBuildIdCompatibilityRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Operation: &workflowservice.UpdateWorkerBuildIdCompatibilityRequest_AddNewBuildIdInNewDefaultSet{ AddNewBuildIdInNewDefaultSet: buildIdv1, @@ -2251,7 +2251,7 @@ func (s *AdvancedVisibilitySuite) Test_BuildIdIndexedOnReset() { <-startedCh resetResult, err := s.sdkClient.ResetWorkflowExecution(ctx, &workflowservice.ResetWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: &commonpb.WorkflowExecution{WorkflowId: id}, WorkflowTaskFinishEventId: 3, }) @@ -2261,7 +2261,7 @@ func (s *AdvancedVisibilitySuite) Test_BuildIdIndexedOnReset() { s.Eventually(func() bool { response, err := s.FrontendClient().ListWorkflowExecutions(ctx, &workflowservice.ListWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Query: fmt.Sprintf("BuildIds = %q AND RunId = %q", worker_versioning.VersionedBuildIdSearchAttribute(buildIdv1), resetResult.RunId), PageSize: testcore.DefaultPageSize, }) @@ -2292,7 +2292,7 @@ func (s *AdvancedVisibilitySuite) Test_BuildIdIndexedOnRetry() { // Declare v1 _, err := s.FrontendClient().UpdateWorkerBuildIdCompatibility(ctx, &workflowservice.UpdateWorkerBuildIdCompatibilityRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Operation: &workflowservice.UpdateWorkerBuildIdCompatibilityRequest_AddNewBuildIdInNewDefaultSet{ AddNewBuildIdInNewDefaultSet: buildIdv1, @@ -2328,7 +2328,7 @@ func (s *AdvancedVisibilitySuite) Test_BuildIdIndexedOnRetry() { s.Eventually(func() bool { response, err := s.FrontendClient().ListWorkflowExecutions(ctx, &workflowservice.ListWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Query: fmt.Sprintf("BuildIds = %q", worker_versioning.VersionedBuildIdSearchAttribute(buildIdv1)), PageSize: testcore.DefaultPageSize, }) @@ -2354,7 +2354,7 @@ func (s *AdvancedVisibilitySuite) TestWorkerTaskReachability_ByBuildId() { var err error _, err = s.FrontendClient().UpdateWorkerBuildIdCompatibility(ctx, &workflowservice.UpdateWorkerBuildIdCompatibilityRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tq1, Operation: &workflowservice.UpdateWorkerBuildIdCompatibilityRequest_AddNewBuildIdInNewDefaultSet{ AddNewBuildIdInNewDefaultSet: v0, @@ -2362,7 +2362,7 @@ func (s *AdvancedVisibilitySuite) TestWorkerTaskReachability_ByBuildId() { }) s.Require().NoError(err) _, err = s.FrontendClient().UpdateWorkerBuildIdCompatibility(ctx, &workflowservice.UpdateWorkerBuildIdCompatibilityRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tq1, Operation: &workflowservice.UpdateWorkerBuildIdCompatibilityRequest_AddNewCompatibleBuildId{ AddNewCompatibleBuildId: &workflowservice.UpdateWorkerBuildIdCompatibilityRequest_AddNewCompatibleVersion{ @@ -2373,7 +2373,7 @@ func (s *AdvancedVisibilitySuite) TestWorkerTaskReachability_ByBuildId() { }) s.Require().NoError(err) _, err = s.FrontendClient().UpdateWorkerBuildIdCompatibility(ctx, &workflowservice.UpdateWorkerBuildIdCompatibilityRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tq2, Operation: &workflowservice.UpdateWorkerBuildIdCompatibilityRequest_AddNewBuildIdInNewDefaultSet{ AddNewBuildIdInNewDefaultSet: v0, @@ -2383,7 +2383,7 @@ func (s *AdvancedVisibilitySuite) TestWorkerTaskReachability_ByBuildId() { // Map v0 to a third queue to test limit enforcement _, err = s.FrontendClient().UpdateWorkerBuildIdCompatibility(ctx, &workflowservice.UpdateWorkerBuildIdCompatibilityRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tq3, Operation: &workflowservice.UpdateWorkerBuildIdCompatibilityRequest_AddNewBuildIdInNewDefaultSet{ AddNewBuildIdInNewDefaultSet: v0, @@ -2394,7 +2394,7 @@ func (s *AdvancedVisibilitySuite) TestWorkerTaskReachability_ByBuildId() { var reachabilityResponse *workflowservice.GetWorkerTaskReachabilityResponse reachabilityResponse, err = s.FrontendClient().GetWorkerTaskReachability(ctx, &workflowservice.GetWorkerTaskReachabilityRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), BuildIds: []string{v0}, Reachability: enumspb.TASK_REACHABILITY_EXISTING_WORKFLOWS, }) @@ -2411,7 +2411,7 @@ func (s *AdvancedVisibilitySuite) TestWorkerTaskReachability_ByBuildId() { // Start a workflow on tq1 and verify it affects the reachability of v0.1 _, err = s.FrontendClient().StartWorkflowExecution(ctx, &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: testcore.RandomizeStr(s.T().Name()), WorkflowType: &commonpb.WorkflowType{Name: "dont-care"}, TaskQueue: &taskqueuepb.TaskQueue{Name: tq1, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, @@ -2423,14 +2423,14 @@ func (s *AdvancedVisibilitySuite) TestWorkerTaskReachability_ByBuildId() { // Complete the workflow and verify it affects reachability of v0.1 task, err := s.FrontendClient().PollWorkflowTaskQueue(ctx, &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{Name: tq1, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, WorkerVersionCapabilities: &commonpb.WorkerVersionCapabilities{BuildId: v01, UseVersioning: true}, }) s.Require().NoError(err) s.Require().NotEmpty(task.GetTaskToken()) _, err = s.FrontendClient().RespondWorkflowTaskCompleted(ctx, &workflowservice.RespondWorkflowTaskCompletedRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskToken: task.TaskToken, WorkerVersionStamp: &commonpb.WorkerVersionStamp{BuildId: v01, UseVersioning: true}, Commands: []*commandpb.Command{{ @@ -2445,7 +2445,7 @@ func (s *AdvancedVisibilitySuite) TestWorkerTaskReachability_ByBuildId() { // Make v1 default for queue 1 _, err = s.FrontendClient().UpdateWorkerBuildIdCompatibility(ctx, &workflowservice.UpdateWorkerBuildIdCompatibilityRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tq1, Operation: &workflowservice.UpdateWorkerBuildIdCompatibilityRequest_AddNewBuildIdInNewDefaultSet{ AddNewBuildIdInNewDefaultSet: buildIdv1, @@ -2470,7 +2470,7 @@ func (s *AdvancedVisibilitySuite) TestWorkerTaskReachability_ByBuildId_NotInName buildId := s.T().Name() + "v0" reachabilityResponse, err := s.FrontendClient().GetWorkerTaskReachability(ctx, &workflowservice.GetWorkerTaskReachabilityRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), BuildIds: []string{buildId}, Reachability: enumspb.TASK_REACHABILITY_EXISTING_WORKFLOWS, }) @@ -2489,7 +2489,7 @@ func (s *AdvancedVisibilitySuite) TestWorkerTaskReachability_ByBuildId_NotInTask checkReachability := func() { reachabilityResponse, err := s.FrontendClient().GetWorkerTaskReachability(ctx, &workflowservice.GetWorkerTaskReachabilityRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), BuildIds: []string{v01}, TaskQueues: []string{tq}, }) @@ -2505,7 +2505,7 @@ func (s *AdvancedVisibilitySuite) TestWorkerTaskReachability_ByBuildId_NotInTask // Same but with a versioned task queue _, err := s.FrontendClient().UpdateWorkerBuildIdCompatibility(ctx, &workflowservice.UpdateWorkerBuildIdCompatibilityRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tq, Operation: &workflowservice.UpdateWorkerBuildIdCompatibilityRequest_AddNewBuildIdInNewDefaultSet{ AddNewBuildIdInNewDefaultSet: v0, @@ -2519,7 +2519,7 @@ func (s *AdvancedVisibilitySuite) TestWorkerTaskReachability_EmptyBuildIds() { ctx := testcore.NewContext() _, err := s.FrontendClient().GetWorkerTaskReachability(ctx, &workflowservice.GetWorkerTaskReachabilityRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), }) var invalidArgument *serviceerror.InvalidArgument s.Require().ErrorAs(err, &invalidArgument) @@ -2529,7 +2529,7 @@ func (s *AdvancedVisibilitySuite) TestWorkerTaskReachability_TooManyBuildIds() { ctx := testcore.NewContext() _, err := s.FrontendClient().GetWorkerTaskReachability(ctx, &workflowservice.GetWorkerTaskReachabilityRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), BuildIds: []string{"", "v1"}, }) var invalidArgument *serviceerror.InvalidArgument @@ -2540,7 +2540,7 @@ func (s *AdvancedVisibilitySuite) TestWorkerTaskReachability_Unversioned_InNames ctx := testcore.NewContext() _, err := s.FrontendClient().GetWorkerTaskReachability(ctx, &workflowservice.GetWorkerTaskReachabilityRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), BuildIds: []string{""}, }) var invalidArgument *serviceerror.InvalidArgument @@ -2553,7 +2553,7 @@ func (s *AdvancedVisibilitySuite) TestWorkerTaskReachability_Unversioned_InTaskQ _, err := s.FrontendClient().StartWorkflowExecution(ctx, &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: testcore.RandomizeStr(s.T().Name()), WorkflowType: &commonpb.WorkflowType{Name: "dont-care"}, TaskQueue: &taskqueuepb.TaskQueue{Name: tq, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, @@ -2564,13 +2564,13 @@ func (s *AdvancedVisibilitySuite) TestWorkerTaskReachability_Unversioned_InTaskQ s.checkReachability(ctx, tq, "", enumspb.TASK_REACHABILITY_NEW_WORKFLOWS, enumspb.TASK_REACHABILITY_OPEN_WORKFLOWS) task, err := s.FrontendClient().PollWorkflowTaskQueue(ctx, &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{Name: tq, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, }) s.Require().NoError(err) s.Require().NotEmpty(task.GetTaskToken()) _, err = s.FrontendClient().RespondWorkflowTaskCompleted(ctx, &workflowservice.RespondWorkflowTaskCompletedRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskToken: task.TaskToken, Commands: []*commandpb.Command{{ CommandType: enumspb.COMMAND_TYPE_COMPLETE_WORKFLOW_EXECUTION, @@ -2584,7 +2584,7 @@ func (s *AdvancedVisibilitySuite) TestWorkerTaskReachability_Unversioned_InTaskQ // Make the task queue versioned and rerun our assertion _, err = s.FrontendClient().UpdateWorkerBuildIdCompatibility(ctx, &workflowservice.UpdateWorkerBuildIdCompatibilityRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tq, Operation: &workflowservice.UpdateWorkerBuildIdCompatibilityRequest_AddNewBuildIdInNewDefaultSet{ AddNewBuildIdInNewDefaultSet: s.T().Name() + "-v0", @@ -2610,7 +2610,7 @@ func (s *AdvancedVisibilitySuite) TestBuildIdScavenger_DeletesUnusedBuildId() { var err error _, err = s.FrontendClient().UpdateWorkerBuildIdCompatibility(ctx, &workflowservice.UpdateWorkerBuildIdCompatibilityRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tq, Operation: &workflowservice.UpdateWorkerBuildIdCompatibilityRequest_AddNewBuildIdInNewDefaultSet{ AddNewBuildIdInNewDefaultSet: buildIdv0, @@ -2618,7 +2618,7 @@ func (s *AdvancedVisibilitySuite) TestBuildIdScavenger_DeletesUnusedBuildId() { }) s.Require().NoError(err) _, err = s.FrontendClient().UpdateWorkerBuildIdCompatibility(ctx, &workflowservice.UpdateWorkerBuildIdCompatibilityRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tq, Operation: &workflowservice.UpdateWorkerBuildIdCompatibilityRequest_AddNewBuildIdInNewDefaultSet{ AddNewBuildIdInNewDefaultSet: buildIdv1, @@ -2644,7 +2644,7 @@ func (s *AdvancedVisibilitySuite) TestBuildIdScavenger_DeletesUnusedBuildId() { s.Require().Equal([]string{buildIdv1}, compatibility.Sets[0].BuildIDs) // Make sure the build ID was removed from the build ID->task queue mapping res, err := s.sdkClient.WorkflowService().GetWorkerTaskReachability(ctx, &workflowservice.GetWorkerTaskReachabilityRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), BuildIds: []string{buildIdv0}, }) s.Require().NoError(err) @@ -2660,7 +2660,7 @@ func (s *AdvancedVisibilitySuite) TestScheduleListingWithSearchAttributes() { workflowID := "test-schedule-" + uuid.New() schedule := &workflowservice.CreateScheduleRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), RequestId: uuid.New(), ScheduleId: scheduleID, Schedule: &schedulepb.Schedule{ @@ -2686,7 +2686,7 @@ func (s *AdvancedVisibilitySuite) TestScheduleListingWithSearchAttributes() { s.NoError(err) listRequest := &workflowservice.ListSchedulesRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), MaximumPageSize: 1, Query: fmt.Sprintf(`%s = "%s"`, searchattribute.ScheduleID, scheduleID), } @@ -2744,7 +2744,7 @@ func (s *AdvancedVisibilitySuite) TestScheduleListingWithSearchAttributes() { func (s *AdvancedVisibilitySuite) checkReachability(ctx context.Context, taskQueue, buildId string, expectedReachability ...enumspb.TaskReachability) { s.Require().Eventually(func() bool { reachabilityResponse, err := s.FrontendClient().GetWorkerTaskReachability(ctx, &workflowservice.GetWorkerTaskReachabilityRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), BuildIds: []string{buildId}, TaskQueues: []string{taskQueue}, Reachability: expectedReachability[len(expectedReachability)-1], @@ -2773,7 +2773,7 @@ func (s *AdvancedVisibilitySuite) checkReachability(ctx context.Context, taskQue func (s *AdvancedVisibilitySuite) getBuildIds(ctx context.Context, execution *commonpb.WorkflowExecution) []string { description, err := s.FrontendClient().DescribeWorkflowExecution(ctx, &workflowservice.DescribeWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: execution, }) s.NoError(err) @@ -2817,14 +2817,14 @@ func (s *AdvancedVisibilitySuite) addCustomKeywordSearchAttribute(ctx context.Co SearchAttributes: map[string]enumspb.IndexedValueType{ attrName: enumspb.INDEXED_VALUE_TYPE_KEYWORD, }, - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), }) s.NoError(err) // Wait for search attribute to be available s.Eventually(func() bool { descResp, err := s.OperatorClient().ListSearchAttributes(ctx, &operatorservice.ListSearchAttributesRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), }) if err != nil { return false diff --git a/tests/archival_test.go b/tests/archival_test.go index 3c93453b13d..d4ceb3fd6b8 100644 --- a/tests/archival_test.go +++ b/tests/archival_test.go @@ -48,6 +48,7 @@ import ( "go.temporal.io/server/common/convert" "go.temporal.io/server/common/dynamicconfig" "go.temporal.io/server/common/log/tag" + "go.temporal.io/server/common/namespace" "go.temporal.io/server/common/payloads" "go.temporal.io/server/common/persistence" "go.temporal.io/server/common/persistence/versionhistory" @@ -104,34 +105,32 @@ func (s *ArchivalSuite) SetupTest() { func (s *ArchivalSuite) TestArchival_TimerQueueProcessor() { s.True(s.GetTestCluster().ArchivalBase().Metadata().GetHistoryConfig().ClusterConfiguredForArchival()) - namespaceID := s.GetNamespaceID(s.ArchivalNamespace()) workflowID := "archival-timer-queue-processor-workflow-id" workflowType := "archival-timer-queue-processor-type" taskQueue := "archival-timer-queue-processor-task-queue" numActivities := 1 numRuns := 1 - workflowInfo := s.startAndFinishWorkflow(workflowID, workflowType, taskQueue, s.ArchivalNamespace(), namespaceID, numActivities, numRuns)[0] + workflowInfo := s.startAndFinishWorkflow(workflowID, workflowType, taskQueue, s.ArchivalNamespace(), numActivities, numRuns)[0] - s.True(s.isArchived(s.ArchivalNamespace(), workflowInfo.execution)) + s.True(s.isArchived(s.ArchivalNamespaceID(), workflowInfo.execution)) s.True(s.isHistoryDeleted(workflowInfo)) - s.True(s.isMutableStateDeleted(namespaceID, workflowInfo.execution)) + s.True(s.isMutableStateDeleted(s.ArchivalNamespaceID(), workflowInfo.execution)) } func (s *ArchivalSuite) TestArchival_ContinueAsNew() { s.True(s.GetTestCluster().ArchivalBase().Metadata().GetHistoryConfig().ClusterConfiguredForArchival()) - namespaceID := s.GetNamespaceID(s.ArchivalNamespace()) workflowID := "archival-continueAsNew-workflow-id" workflowType := "archival-continueAsNew-workflow-type" taskQueue := "archival-continueAsNew-task-queue" numActivities := 1 numRuns := 5 - workflowInfos := s.startAndFinishWorkflow(workflowID, workflowType, taskQueue, s.ArchivalNamespace(), namespaceID, numActivities, numRuns) + workflowInfos := s.startAndFinishWorkflow(workflowID, workflowType, taskQueue, s.ArchivalNamespace(), numActivities, numRuns) for _, workflowInfo := range workflowInfos { - s.True(s.isArchived(s.ArchivalNamespace(), workflowInfo.execution)) + s.True(s.isArchived(s.ArchivalNamespaceID(), workflowInfo.execution)) s.True(s.isHistoryDeleted(workflowInfo)) - s.True(s.isMutableStateDeleted(namespaceID, workflowInfo.execution)) + s.True(s.isMutableStateDeleted(s.ArchivalNamespaceID(), workflowInfo.execution)) } } @@ -140,30 +139,28 @@ func (s *ArchivalSuite) TestArchival_ArchiverWorker() { s.True(s.GetTestCluster().ArchivalBase().Metadata().GetHistoryConfig().ClusterConfiguredForArchival()) - namespaceID := s.GetNamespaceID(s.ArchivalNamespace()) workflowID := "archival-archiver-worker-workflow-id" workflowType := "archival-archiver-worker-workflow-type" taskQueue := "archival-archiver-worker-task-queue" numActivities := 10 - workflowInfo := s.startAndFinishWorkflow(workflowID, workflowType, taskQueue, s.ArchivalNamespace(), namespaceID, numActivities, 1)[0] + workflowInfo := s.startAndFinishWorkflow(workflowID, workflowType, taskQueue, s.ArchivalNamespace(), numActivities, 1)[0] - s.True(s.isArchived(s.ArchivalNamespace(), workflowInfo.execution)) + s.True(s.isArchived(s.ArchivalNamespaceID(), workflowInfo.execution)) s.True(s.isHistoryDeleted(workflowInfo)) - s.True(s.isMutableStateDeleted(namespaceID, workflowInfo.execution)) + s.True(s.isMutableStateDeleted(s.ArchivalNamespaceID(), workflowInfo.execution)) } func (s *ArchivalSuite) TestVisibilityArchival() { s.True(s.GetTestCluster().ArchivalBase().Metadata().GetVisibilityConfig().ClusterConfiguredForArchival()) - namespaceID := s.GetNamespaceID(s.ArchivalNamespace()) workflowID := "archival-visibility-workflow-id" workflowType := "archival-visibility-workflow-type" taskQueue := "archival-visibility-task-queue" numActivities := 3 numRuns := 5 startTime := time.Now().UnixNano() - s.startAndFinishWorkflow(workflowID, workflowType, taskQueue, s.ArchivalNamespace(), namespaceID, numActivities, numRuns) - s.startAndFinishWorkflow("some other workflowID", "some other workflow type", taskQueue, s.ArchivalNamespace(), namespaceID, numActivities, numRuns) + s.startAndFinishWorkflow(workflowID, workflowType, taskQueue, s.ArchivalNamespace(), numActivities, numRuns) + s.startAndFinishWorkflow("some other workflowID", "some other workflow type", taskQueue, s.ArchivalNamespace(), numActivities, numRuns) endTime := time.Now().UnixNano() var executions []*workflowpb.WorkflowExecutionInfo @@ -171,7 +168,7 @@ func (s *ArchivalSuite) TestVisibilityArchival() { for i := 0; i != retryLimit; i++ { executions = []*workflowpb.WorkflowExecutionInfo{} request := &workflowservice.ListArchivedWorkflowExecutionsRequest{ - Namespace: s.ArchivalNamespace(), + Namespace: s.ArchivalNamespace().String(), PageSize: 2, Query: fmt.Sprintf("CloseTime >= %v and CloseTime <= %v and WorkflowType = '%s'", startTime, endTime, workflowType), } @@ -203,7 +200,7 @@ func (s *ArchivalSuite) TestVisibilityArchival() { } // isArchived returns true if both the workflow history and workflow visibility are archived. -func (s *ArchivalSuite) isArchived(namespace string, execution *commonpb.WorkflowExecution) bool { +func (s *ArchivalSuite) isArchived(namespaceID namespace.ID, execution *commonpb.WorkflowExecution) bool { serviceName := string(primitives.HistoryService) historyURI, err := archiver.NewURI(s.GetTestCluster().ArchivalBase().HistoryURI()) s.NoError(err) @@ -226,10 +223,9 @@ func (s *ArchivalSuite) isArchived(namespace string, execution *commonpb.Workflo if i > 0 { time.Sleep(retryBackoffTime) //nolint:forbidigo } - namespaceID := s.GetNamespaceID(namespace) var historyResponse *archiver.GetHistoryResponse historyResponse, err = historyArchiver.Get(ctx, historyURI, &archiver.GetHistoryRequest{ - NamespaceID: namespaceID, + NamespaceID: namespaceID.String(), WorkflowID: execution.GetWorkflowId(), RunID: execution.GetRunId(), PageSize: 1, @@ -245,7 +241,7 @@ func (s *ArchivalSuite) isArchived(namespace string, execution *commonpb.Workflo ctx, visibilityURI, &archiver.QueryVisibilityRequest{ - NamespaceID: namespaceID, + NamespaceID: namespaceID.String(), PageSize: 1, Query: fmt.Sprintf( "WorkflowId = '%s' and RunId = '%s'", @@ -271,9 +267,8 @@ func (s *ArchivalSuite) isArchived(namespace string, execution *commonpb.Workflo func (s *ArchivalSuite) isHistoryDeleted( workflowInfo archivalWorkflowInfo, ) bool { - namespaceID := s.GetNamespaceID(s.ArchivalNamespace()) shardID := common.WorkflowIDToHistoryShard( - namespaceID, + s.ArchivalNamespaceID().String(), workflowInfo.execution.WorkflowId, s.GetTestClusterConfig().HistoryConfig.NumHistoryShards, ) @@ -300,12 +295,12 @@ func (s *ArchivalSuite) isHistoryDeleted( return false } -func (s *ArchivalSuite) isMutableStateDeleted(namespaceID string, execution *commonpb.WorkflowExecution) bool { - shardID := common.WorkflowIDToHistoryShard(namespaceID, execution.GetWorkflowId(), +func (s *ArchivalSuite) isMutableStateDeleted(namespaceID namespace.ID, execution *commonpb.WorkflowExecution) bool { + shardID := common.WorkflowIDToHistoryShard(namespaceID.String(), execution.GetWorkflowId(), s.GetTestClusterConfig().HistoryConfig.NumHistoryShards) request := &persistence.GetWorkflowExecutionRequest{ ShardID: shardID, - NamespaceID: namespaceID, + NamespaceID: namespaceID.String(), WorkflowID: execution.WorkflowId, RunID: execution.RunId, } @@ -321,7 +316,8 @@ func (s *ArchivalSuite) isMutableStateDeleted(namespaceID string, execution *com } func (s *ArchivalSuite) startAndFinishWorkflow( - id, wt, tq, namespace, namespaceID string, + id, wt, tq string, + nsName namespace.Name, numActivities, numRuns int, ) []archivalWorkflowInfo { identity := "worker1" @@ -330,7 +326,7 @@ func (s *ArchivalSuite) startAndFinishWorkflow( taskQueue := &taskqueuepb.TaskQueue{Name: tq, Kind: enumspb.TASK_QUEUE_KIND_NORMAL} request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: namespace, + Namespace: nsName.String(), WorkflowId: id, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -351,7 +347,7 @@ func (s *ArchivalSuite) startAndFinishWorkflow( runCounter := 1 wtHandler := func(task *workflowservice.PollWorkflowTaskQueueResponse) ([]*commandpb.Command, error) { - branchToken, err := s.getBranchToken(namespace, task.WorkflowExecution) + branchToken, err := s.getBranchToken(nsName, task.WorkflowExecution) s.NoError(err) workflowInfos[runCounter-1] = archivalWorkflowInfo{ @@ -415,7 +411,7 @@ func (s *ArchivalSuite) startAndFinishWorkflow( poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: namespace, + Namespace: nsName.String(), TaskQueue: taskQueue, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -450,12 +446,12 @@ func (s *ArchivalSuite) startAndFinishWorkflow( } func (s *ArchivalSuite) getBranchToken( - namespace string, + nsName namespace.Name, execution *commonpb.WorkflowExecution, ) ([]byte, error) { descResp, err := s.AdminClient().DescribeMutableState(testcore.NewContext(), &adminservice.DescribeMutableStateRequest{ - Namespace: namespace, + Namespace: nsName.String(), Execution: execution, }) if err != nil { diff --git a/tests/callbacks_test.go b/tests/callbacks_test.go index 3637d3d0779..dcb289ad68e 100644 --- a/tests/callbacks_test.go +++ b/tests/callbacks_test.go @@ -176,7 +176,7 @@ func (s *CallbacksSuite) TestWorkflowCallbacks_InvalidArgument() { } request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: testcore.RandomizeStr(s.T().Name()), WorkflowType: &commonpb.WorkflowType{Name: workflowType}, TaskQueue: &taskqueuepb.TaskQueue{Name: taskQueue, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, @@ -246,7 +246,7 @@ func (s *CallbacksSuite) TestWorkflowNexusCallbacks_CarriedOver() { ctx := testcore.NewContext() sdkClient, err := client.Dial(client.Options{ HostPort: s.FrontendGRPCAddress(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), }) s.NoError(err) @@ -270,7 +270,7 @@ func (s *CallbacksSuite) TestWorkflowNexusCallbacks_CarriedOver() { request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: testcore.RandomizeStr(s.T().Name()), WorkflowType: &commonpb.WorkflowType{Name: workflowType}, TaskQueue: &taskqueuepb.TaskQueue{Name: taskQueue, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, @@ -342,7 +342,7 @@ func (s *CallbacksSuite) TestNexusResetWorkflowWithCallback() { ctx := testcore.NewContext() sdkClient, err := client.Dial(client.Options{ HostPort: s.FrontendGRPCAddress(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), }) s.NoError(err) @@ -377,7 +377,7 @@ func (s *CallbacksSuite) TestNexusResetWorkflowWithCallback() { request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: testcore.RandomizeStr(s.T().Name()), WorkflowType: &commonpb.WorkflowType{Name: "longRunningWorkflow"}, TaskQueue: &taskqueuepb.TaskQueue{Name: taskQueue, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, @@ -408,12 +408,12 @@ func (s *CallbacksSuite) TestNexusResetWorkflowWithCallback() { 2 WorkflowTaskScheduled 3 WorkflowTaskStarted 4 WorkflowTaskCompleted`, - s.GetHistoryFunc(s.Namespace(), workflowExecution), + s.GetHistoryFunc(s.Namespace().String(), workflowExecution), 5*time.Second, 10*time.Millisecond) resetWfResponse, err := sdkClient.ResetWorkflowExecution(ctx, &workflowservice.ResetWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: workflowExecution, Reason: "TestNexusResetWorkflowWithCallback", diff --git a/tests/cancel_workflow_test.go b/tests/cancel_workflow_test.go index e71df868cf3..06ab008cc18 100644 --- a/tests/cancel_workflow_test.go +++ b/tests/cancel_workflow_test.go @@ -66,7 +66,7 @@ func (s *CancelWorkflowSuite) TestExternalRequestCancelWorkflowExecution() { request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -78,7 +78,7 @@ func (s *CancelWorkflowSuite) TestExternalRequestCancelWorkflowExecution() { // cancellation to non exist workflow will lead to error _, err := s.FrontendClient().RequestCancelWorkflowExecution(testcore.NewContext(), &workflowservice.RequestCancelWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: &commonpb.WorkflowExecution{ WorkflowId: id, }, @@ -103,7 +103,7 @@ func (s *CancelWorkflowSuite) TestExternalRequestCancelWorkflowExecution() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -112,7 +112,7 @@ func (s *CancelWorkflowSuite) TestExternalRequestCancelWorkflowExecution() { } _, err = s.FrontendClient().RequestCancelWorkflowExecution(testcore.NewContext(), &workflowservice.RequestCancelWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: &commonpb.WorkflowExecution{ WorkflowId: id, RunId: we.RunId, @@ -121,7 +121,7 @@ func (s *CancelWorkflowSuite) TestExternalRequestCancelWorkflowExecution() { s.NoError(err) _, err = s.FrontendClient().RequestCancelWorkflowExecution(testcore.NewContext(), &workflowservice.RequestCancelWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: &commonpb.WorkflowExecution{ WorkflowId: id, RunId: we.RunId, @@ -133,7 +133,7 @@ func (s *CancelWorkflowSuite) TestExternalRequestCancelWorkflowExecution() { s.Logger.Info("PollAndProcessWorkflowTask", tag.Error(err)) s.NoError(err) - historyEvents := s.GetHistory(s.Namespace(), &commonpb.WorkflowExecution{ + historyEvents := s.GetHistory(s.Namespace().String(), &commonpb.WorkflowExecution{ WorkflowId: id, RunId: we.RunId, }) @@ -158,7 +158,7 @@ func (s *CancelWorkflowSuite) TestRequestCancelWorkflowCommandExecution_TargetRu request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -173,7 +173,7 @@ func (s *CancelWorkflowSuite) TestRequestCancelWorkflowCommandExecution_TargetRu foreignRequest := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.ForeignNamespace(), + Namespace: s.ForeignNamespace().String(), WorkflowId: id, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -184,7 +184,7 @@ func (s *CancelWorkflowSuite) TestRequestCancelWorkflowCommandExecution_TargetRu } we2, err0 := s.FrontendClient().StartWorkflowExecution(testcore.NewContext(), foreignRequest) s.NoError(err0) - s.Logger.Info("StartWorkflowExecution on foreign namespace", tag.WorkflowNamespace(s.ForeignNamespace()), tag.WorkflowRunID(we2.RunId)) + s.Logger.Info("StartWorkflowExecution on foreign namespace", tag.WorkflowNamespace(s.ForeignNamespace().String()), tag.WorkflowRunID(we2.RunId)) cancellationSent := false wtHandler := func(task *workflowservice.PollWorkflowTaskQueueResponse) ([]*commandpb.Command, error) { @@ -194,7 +194,7 @@ func (s *CancelWorkflowSuite) TestRequestCancelWorkflowCommandExecution_TargetRu return []*commandpb.Command{{ CommandType: enumspb.COMMAND_TYPE_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION, Attributes: &commandpb.Command_RequestCancelExternalWorkflowExecutionCommandAttributes{RequestCancelExternalWorkflowExecutionCommandAttributes: &commandpb.RequestCancelExternalWorkflowExecutionCommandAttributes{ - Namespace: s.ForeignNamespace(), + Namespace: s.ForeignNamespace().String(), WorkflowId: id, RunId: we2.RunId, }}, @@ -220,7 +220,7 @@ func (s *CancelWorkflowSuite) TestRequestCancelWorkflowCommandExecution_TargetRu poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -254,7 +254,7 @@ func (s *CancelWorkflowSuite) TestRequestCancelWorkflowCommandExecution_TargetRu foreignPoller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.ForeignNamespace(), + Namespace: s.ForeignNamespace().String(), TaskQueue: taskQueue, Identity: identity, WorkflowTaskHandler: foreignwtHandler, @@ -292,7 +292,7 @@ func (s *CancelWorkflowSuite) TestRequestCancelWorkflowCommandExecution_TargetFi request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -307,7 +307,7 @@ func (s *CancelWorkflowSuite) TestRequestCancelWorkflowCommandExecution_TargetFi foreignRequest := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.ForeignNamespace(), + Namespace: s.ForeignNamespace().String(), WorkflowId: id, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -318,7 +318,7 @@ func (s *CancelWorkflowSuite) TestRequestCancelWorkflowCommandExecution_TargetFi } we2, err0 := s.FrontendClient().StartWorkflowExecution(testcore.NewContext(), foreignRequest) s.NoError(err0) - s.Logger.Info("StartWorkflowExecution on foreign namespace", tag.WorkflowNamespace(s.ForeignNamespace()), tag.WorkflowRunID(we2.RunId)) + s.Logger.Info("StartWorkflowExecution on foreign namespace", tag.WorkflowNamespace(s.ForeignNamespace().String()), tag.WorkflowRunID(we2.RunId)) cancellationSent := false wtHandler := func(task *workflowservice.PollWorkflowTaskQueueResponse) ([]*commandpb.Command, error) { @@ -328,7 +328,7 @@ func (s *CancelWorkflowSuite) TestRequestCancelWorkflowCommandExecution_TargetFi return []*commandpb.Command{{ CommandType: enumspb.COMMAND_TYPE_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION, Attributes: &commandpb.Command_RequestCancelExternalWorkflowExecutionCommandAttributes{RequestCancelExternalWorkflowExecutionCommandAttributes: &commandpb.RequestCancelExternalWorkflowExecutionCommandAttributes{ - Namespace: s.ForeignNamespace(), + Namespace: s.ForeignNamespace().String(), WorkflowId: id, RunId: we2.RunId, }}, @@ -354,7 +354,7 @@ func (s *CancelWorkflowSuite) TestRequestCancelWorkflowCommandExecution_TargetFi poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -384,7 +384,7 @@ func (s *CancelWorkflowSuite) TestRequestCancelWorkflowCommandExecution_TargetFi foreignPoller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.ForeignNamespace(), + Namespace: s.ForeignNamespace().String(), TaskQueue: taskQueue, Identity: identity, WorkflowTaskHandler: foreignwtHandler, @@ -422,7 +422,7 @@ func (s *CancelWorkflowSuite) TestRequestCancelWorkflowCommandExecution_TargetNo request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -443,7 +443,7 @@ func (s *CancelWorkflowSuite) TestRequestCancelWorkflowCommandExecution_TargetNo return []*commandpb.Command{{ CommandType: enumspb.COMMAND_TYPE_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION, Attributes: &commandpb.Command_RequestCancelExternalWorkflowExecutionCommandAttributes{RequestCancelExternalWorkflowExecutionCommandAttributes: &commandpb.RequestCancelExternalWorkflowExecutionCommandAttributes{ - Namespace: s.ForeignNamespace(), + Namespace: s.ForeignNamespace().String(), WorkflowId: "some-random-non-existence-workflow-id", }}, }}, nil @@ -468,7 +468,7 @@ func (s *CancelWorkflowSuite) TestRequestCancelWorkflowCommandExecution_TargetNo poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -503,7 +503,7 @@ func (s *CancelWorkflowSuite) TestImmediateChildCancellation_WorkflowTaskFailed( request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -518,7 +518,7 @@ func (s *CancelWorkflowSuite) TestImmediateChildCancellation_WorkflowTaskFailed( _, err := s.FrontendClient().RequestCancelWorkflowExecution(testcore.NewContext(), &workflowservice.RequestCancelWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: &commonpb.WorkflowExecution{ WorkflowId: id, RunId: we.RunId, @@ -555,7 +555,7 @@ func (s *CancelWorkflowSuite) TestImmediateChildCancellation_WorkflowTaskFailed( return []*commandpb.Command{{ CommandType: enumspb.COMMAND_TYPE_START_CHILD_WORKFLOW_EXECUTION, Attributes: &commandpb.Command_StartChildWorkflowExecutionCommandAttributes{StartChildWorkflowExecutionCommandAttributes: &commandpb.StartChildWorkflowExecutionCommandAttributes{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: childWorkflowID, WorkflowType: &commonpb.WorkflowType{Name: "childTypeA"}, TaskQueue: &taskqueuepb.TaskQueue{Name: childTaskQueue, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, @@ -564,7 +564,7 @@ func (s *CancelWorkflowSuite) TestImmediateChildCancellation_WorkflowTaskFailed( }, { CommandType: enumspb.COMMAND_TYPE_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION, Attributes: &commandpb.Command_RequestCancelExternalWorkflowExecutionCommandAttributes{RequestCancelExternalWorkflowExecutionCommandAttributes: &commandpb.RequestCancelExternalWorkflowExecutionCommandAttributes{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: childWorkflowID, ChildWorkflowOnly: true, }}, @@ -600,7 +600,7 @@ func (s *CancelWorkflowSuite) TestImmediateChildCancellation_WorkflowTaskFailed( } taskFailure := workflowtaskFailedEvent.GetWorkflowTaskFailedEventAttributes().GetFailure() - if taskFailure.GetMessage() != fmt.Sprintf("BadRequestCancelExternalWorkflowExecutionAttributes: Start and RequestCancel for child workflow is not allowed in same workflow task. WorkflowId=%s RunId= Namespace=%s", childWorkflowID, s.Namespace()) { + if taskFailure.GetMessage() != fmt.Sprintf("BadRequestCancelExternalWorkflowExecutionAttributes: Start and RequestCancel for child workflow is not allowed in same workflow task. WorkflowId=%s RunId= Namespace=%s", childWorkflowID, s.Namespace().String()) { return nil, errors.New("unexpected workflow task failure") //nolint:err113 } @@ -615,7 +615,7 @@ func (s *CancelWorkflowSuite) TestImmediateChildCancellation_WorkflowTaskFailed( poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -627,14 +627,14 @@ func (s *CancelWorkflowSuite) TestImmediateChildCancellation_WorkflowTaskFailed( _, err = poller.PollAndProcessWorkflowTask() s.Error(err) s.IsType(&serviceerror.InvalidArgument{}, err) - s.Equal(fmt.Sprintf("BadRequestCancelExternalWorkflowExecutionAttributes: Start and RequestCancel for child workflow is not allowed in same workflow task. WorkflowId=%s RunId= Namespace=%s", childWorkflowID, s.Namespace()), err.Error()) + s.Equal(fmt.Sprintf("BadRequestCancelExternalWorkflowExecutionAttributes: Start and RequestCancel for child workflow is not allowed in same workflow task. WorkflowId=%s RunId= Namespace=%s", childWorkflowID, s.Namespace().String()), err.Error()) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted 2 WorkflowTaskScheduled 3 WorkflowExecutionCancelRequested 4 WorkflowTaskStarted - 5 WorkflowTaskFailed`, s.GetHistory(s.Namespace(), &commonpb.WorkflowExecution{ + 5 WorkflowTaskFailed`, s.GetHistory(s.Namespace().String(), &commonpb.WorkflowExecution{ WorkflowId: id, })) @@ -651,18 +651,18 @@ func (s *CancelWorkflowSuite) TestImmediateChildCancellation_WorkflowTaskFailed( 6 WorkflowTaskScheduled 7 WorkflowTaskStarted 8 WorkflowTaskCompleted - 9 WorkflowExecutionCompleted`, s.GetHistory(s.Namespace(), &commonpb.WorkflowExecution{ + 9 WorkflowExecutionCompleted`, s.GetHistory(s.Namespace().String(), &commonpb.WorkflowExecution{ WorkflowId: id, })) _, err = s.FrontendClient().DescribeWorkflowExecution(testcore.NewContext(), &workflowservice.DescribeWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: &commonpb.WorkflowExecution{ WorkflowId: childWorkflowID, }, }) if err == nil { - s.PrintHistoryEvents(s.GetHistory(s.Namespace(), &commonpb.WorkflowExecution{ + s.PrintHistoryEvents(s.GetHistory(s.Namespace().String(), &commonpb.WorkflowExecution{ WorkflowId: childWorkflowID, })) } diff --git a/tests/child_workflow_test.go b/tests/child_workflow_test.go index 1e4810cae0e..b3e074199de 100644 --- a/tests/child_workflow_test.go +++ b/tests/child_workflow_test.go @@ -87,7 +87,7 @@ func (s *ChildWorkflowSuite) TestChildWorkflowExecution() { request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: parentID, WorkflowType: parentWorkflowType, TaskQueue: taskQueueParent, @@ -253,7 +253,7 @@ func (s *ChildWorkflowSuite) TestChildWorkflowExecution() { pollerParent := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueueParent, Identity: identity, WorkflowTaskHandler: wtHandlerParent, @@ -263,7 +263,7 @@ func (s *ChildWorkflowSuite) TestChildWorkflowExecution() { pollerChild := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueueChild, Identity: identity, WorkflowTaskHandler: wtHandlerChild, @@ -273,7 +273,7 @@ func (s *ChildWorkflowSuite) TestChildWorkflowExecution() { pollerGrandchild := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueueGrandchild, Identity: identity, WorkflowTaskHandler: wtHandlerGrandchild, @@ -308,7 +308,7 @@ func (s *ChildWorkflowSuite) TestChildWorkflowExecution() { childStartedEventSearchAttrs := childStartedEventAttrs.GetSearchAttributes() s.Equal(enumspb.EVENT_TYPE_WORKFLOW_EXECUTION_STARTED, childStartedEvent.GetEventType()) // check parent of child workflow is the top-level workflow - s.Equal(s.Namespace(), childStartedEventAttrs.GetParentWorkflowNamespace()) + s.Equal(s.Namespace().String(), childStartedEventAttrs.GetParentWorkflowNamespace()) s.Equal(parentID, childStartedEventAttrs.ParentWorkflowExecution.GetWorkflowId()) s.Equal(we.GetRunId(), childStartedEventAttrs.ParentWorkflowExecution.GetRunId()) s.Equal( @@ -367,7 +367,7 @@ func (s *ChildWorkflowSuite) TestChildWorkflowExecution() { s.NoError(err) s.NotNil(childCompletedEventFromParent) completedAttributes := childCompletedEventFromParent.GetChildWorkflowExecutionCompletedEventAttributes() - s.Equal(s.Namespace(), completedAttributes.Namespace) + s.Equal(s.Namespace().String(), completedAttributes.Namespace) // TODO: change to s.Equal(s.Namespace()ID) once it is available. s.NotEmpty(completedAttributes.NamespaceId) s.Equal(childID, completedAttributes.WorkflowExecution.WorkflowId) @@ -395,7 +395,7 @@ func (s *ChildWorkflowSuite) TestCronChildWorkflowExecution() { request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: parentID, WorkflowType: parentWorkflowType, TaskQueue: taskQueueParent, @@ -479,7 +479,7 @@ func (s *ChildWorkflowSuite) TestCronChildWorkflowExecution() { pollerParent := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueueParent, Identity: identity, WorkflowTaskHandler: wtHandlerParent, @@ -489,7 +489,7 @@ func (s *ChildWorkflowSuite) TestCronChildWorkflowExecution() { pollerChild := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueueChild, Identity: identity, WorkflowTaskHandler: wtHandlerChild, @@ -517,7 +517,7 @@ func (s *ChildWorkflowSuite) TestCronChildWorkflowExecution() { s.NotNil(childStartedEvent) childStartedEventAttrs := childStartedEvent.GetWorkflowExecutionStartedEventAttributes() s.Equal(enumspb.EVENT_TYPE_WORKFLOW_EXECUTION_STARTED, childStartedEvent.GetEventType()) - s.Equal(s.Namespace(), childStartedEventAttrs.GetParentWorkflowNamespace()) + s.Equal(s.Namespace().String(), childStartedEventAttrs.GetParentWorkflowNamespace()) s.Equal(parentID, childStartedEventAttrs.ParentWorkflowExecution.GetWorkflowId()) s.Equal(we.GetRunId(), childStartedEventAttrs.ParentWorkflowExecution.GetRunId()) s.NotNil(childStartedEventAttrs.GetRootWorkflowExecution()) @@ -529,7 +529,7 @@ func (s *ChildWorkflowSuite) TestCronChildWorkflowExecution() { // terminate the child workflow _, terminateErr := s.FrontendClient().TerminateWorkflowExecution(testcore.NewContext(), &workflowservice.TerminateWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: &commonpb.WorkflowExecution{ WorkflowId: childID, }, @@ -551,7 +551,7 @@ func (s *ChildWorkflowSuite) TestCronChildWorkflowExecution() { var closedExecutions []*workflowpb.WorkflowExecutionInfo for i := 0; i < 10; i++ { resp, err := s.FrontendClient().ListClosedWorkflowExecutions(testcore.NewContext(), &workflowservice.ListClosedWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), MaximumPageSize: 100, StartTimeFilter: startFilter, }) @@ -600,7 +600,7 @@ func (s *ChildWorkflowSuite) TestRetryChildWorkflowExecution() { request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: parentID, WorkflowType: parentWorkflowType, TaskQueue: taskQueueParent, @@ -707,7 +707,7 @@ func (s *ChildWorkflowSuite) TestRetryChildWorkflowExecution() { pollerParent := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueueParent, Identity: identity, WorkflowTaskHandler: wtHandlerParent, @@ -717,7 +717,7 @@ func (s *ChildWorkflowSuite) TestRetryChildWorkflowExecution() { pollerChild := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueueChild, Identity: identity, WorkflowTaskHandler: wtHandlerChild, @@ -745,7 +745,7 @@ func (s *ChildWorkflowSuite) TestRetryChildWorkflowExecution() { s.NotNil(childStartedEvent) childStartedEventAttrs := childStartedEvent.GetWorkflowExecutionStartedEventAttributes() s.Equal(enumspb.EVENT_TYPE_WORKFLOW_EXECUTION_STARTED, childStartedEvent.GetEventType()) - s.Equal(s.Namespace(), childStartedEventAttrs.GetParentWorkflowNamespace()) + s.Equal(s.Namespace().String(), childStartedEventAttrs.GetParentWorkflowNamespace()) s.Equal(parentID, childStartedEventAttrs.ParentWorkflowExecution.GetWorkflowId()) s.Equal(we.GetRunId(), childStartedEventAttrs.ParentWorkflowExecution.GetRunId()) s.NotNil(childStartedEventAttrs.GetRootWorkflowExecution()) @@ -762,7 +762,7 @@ func (s *ChildWorkflowSuite) TestRetryChildWorkflowExecution() { s.NotNil(childStartedEvent) childStartedEventAttrs = childStartedEvent.GetWorkflowExecutionStartedEventAttributes() s.Equal(enumspb.EVENT_TYPE_WORKFLOW_EXECUTION_STARTED, childStartedEvent.GetEventType()) - s.Equal(s.Namespace(), childStartedEventAttrs.GetParentWorkflowNamespace()) + s.Equal(s.Namespace().String(), childStartedEventAttrs.GetParentWorkflowNamespace()) s.Equal(parentID, childStartedEventAttrs.ParentWorkflowExecution.GetWorkflowId()) s.Equal(we.GetRunId(), childStartedEventAttrs.ParentWorkflowExecution.GetRunId()) s.NotNil(childStartedEventAttrs.GetRootWorkflowExecution()) @@ -779,7 +779,7 @@ func (s *ChildWorkflowSuite) TestRetryChildWorkflowExecution() { s.NotNil(childStartedEvent) childStartedEventAttrs = childStartedEvent.GetWorkflowExecutionStartedEventAttributes() s.Equal(enumspb.EVENT_TYPE_WORKFLOW_EXECUTION_STARTED, childStartedEvent.GetEventType()) - s.Equal(s.Namespace(), childStartedEventAttrs.GetParentWorkflowNamespace()) + s.Equal(s.Namespace().String(), childStartedEventAttrs.GetParentWorkflowNamespace()) s.Equal(parentID, childStartedEventAttrs.ParentWorkflowExecution.GetWorkflowId()) s.Equal(we.GetRunId(), childStartedEventAttrs.ParentWorkflowExecution.GetRunId()) s.NotNil(childStartedEventAttrs.GetRootWorkflowExecution()) @@ -815,7 +815,7 @@ func (s *ChildWorkflowSuite) TestRetryFailChildWorkflowExecution() { request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: parentID, WorkflowType: parentWorkflowType, TaskQueue: taskQueueParent, @@ -911,7 +911,7 @@ func (s *ChildWorkflowSuite) TestRetryFailChildWorkflowExecution() { pollerParent := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueueParent, Identity: identity, WorkflowTaskHandler: wtHandlerParent, @@ -921,7 +921,7 @@ func (s *ChildWorkflowSuite) TestRetryFailChildWorkflowExecution() { pollerChild := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueueChild, Identity: identity, WorkflowTaskHandler: wtHandlerChild, diff --git a/tests/client_data_converter_test.go b/tests/client_data_converter_test.go index bf71bea2fc9..13d98e81a59 100644 --- a/tests/client_data_converter_test.go +++ b/tests/client_data_converter_test.go @@ -108,7 +108,7 @@ func testChildWorkflow(ctx workflow.Context, totalCount, runCount int) (string, func (s *ClientDataConverterTestSuite) startWorkerWithDataConverter(tl string, dataConverter converter.DataConverter) (sdkclient.Client, worker.Worker) { sdkClient, err := sdkclient.Dial(sdkclient.Options{ HostPort: s.FrontendGRPCAddress(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), DataConverter: dataConverter, }) if err != nil { diff --git a/tests/client_misc_test.go b/tests/client_misc_test.go index 00276ab6825..01bc087cca6 100644 --- a/tests/client_misc_test.go +++ b/tests/client_misc_test.go @@ -274,11 +274,10 @@ func (s *ClientMiscTestSuite) TestTooManyCancelRequests() { defer cancel() s.Error(run.Get(ctx, nil)) } - namespaceID := s.GetNamespaceID(s.Namespace()) - shardID := common.WorkflowIDToHistoryShard(namespaceID, cancelerWorkflowId, s.GetTestClusterConfig().HistoryConfig.NumHistoryShards) + shardID := common.WorkflowIDToHistoryShard(s.NamespaceID().String(), cancelerWorkflowId, s.GetTestClusterConfig().HistoryConfig.NumHistoryShards) workflowExecution, err := s.GetTestCluster().ExecutionManager().GetWorkflowExecution(ctx, &persistence.GetWorkflowExecutionRequest{ ShardID: shardID, - NamespaceID: namespaceID, + NamespaceID: s.NamespaceID().String(), WorkflowID: cancelerWorkflowId, RunID: run.GetRunID(), }) @@ -443,7 +442,7 @@ func (s *ClientMiscTestSuite) TestStickyAutoReset() { var stickyQueue string s.Eventually(func() bool { ms, err := s.AdminClient().DescribeMutableState(ctx, &adminservice.DescribeMutableStateRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: &commonpb.WorkflowExecution{ WorkflowId: future.GetID(), }, @@ -459,7 +458,7 @@ func (s *ClientMiscTestSuite) TestStickyAutoReset() { //nolint:forbidigo time.Sleep(time.Second * 11) // wait 11s (longer than 10s timeout), after this time, matching will detect StickyWorkerUnavailable resp, err := s.FrontendClient().DescribeTaskQueue(ctx, &workflowservice.DescribeTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{Name: stickyQueue, Kind: enumspb.TASK_QUEUE_KIND_STICKY, NormalName: s.TaskQueue()}, TaskQueueType: enumspb.TASK_QUEUE_TYPE_WORKFLOW, }) @@ -477,7 +476,7 @@ func (s *ClientMiscTestSuite) TestStickyAutoReset() { // check that mutable state still has sticky enabled ms, err := s.AdminClient().DescribeMutableState(ctx, &adminservice.DescribeMutableStateRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: &commonpb.WorkflowExecution{ WorkflowId: future.GetID(), }, @@ -488,7 +487,7 @@ func (s *ClientMiscTestSuite) TestStickyAutoReset() { // now poll from normal queue, and it should see the full history. task, err := s.FrontendClient().PollWorkflowTaskQueue(ctx, &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{Name: s.TaskQueue(), Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, }) @@ -575,7 +574,7 @@ func (s *ClientMiscTestSuite) TestWorkflowCanBeCompletedDespiteAdmittedUpdate() for { time.Sleep(10 * time.Millisecond) //nolint:forbidigo _, err = s.SdkClient().WorkflowService().PollWorkflowExecutionUpdate(ctx, &workflowservice.PollWorkflowExecutionUpdateRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), UpdateRef: tv.UpdateRef(), Identity: "my-identity", WaitPolicy: &updatepb.WaitPolicy{ @@ -611,7 +610,7 @@ func (s *ClientMiscTestSuite) TestWorkflowCanBeCompletedDespiteAdmittedUpdate() 4 WorkflowTaskCompleted 5 MarkerRecorded 6 WorkflowExecutionCompleted`, - s.GetHistory(s.Namespace(), tv.WorkflowExecution())) + s.GetHistory(s.Namespace().String(), tv.WorkflowExecution())) } func (s *ClientMiscTestSuite) Test_CancelActivityAndTimerBeforeComplete() { @@ -866,7 +865,7 @@ func (s *ClientMiscTestSuite) Test_BufferedQuery() { time.Sleep(2 * time.Second) //nolint:forbidigo // make DescribeMutableState call, which force mutable state to reload from db _, err := s.AdminClient().DescribeMutableState(ctx, &adminservice.DescribeMutableStateRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: &commonpb.WorkflowExecution{ WorkflowId: id, RunId: workflowRun.GetRunID(), @@ -991,7 +990,7 @@ func (s *ClientMiscTestSuite) TestBufferedSignalCausesUnhandledCommandAndSchedul 8 WorkflowTaskCompleted 9 MarkerRecorded 10 WorkflowExecutionCompleted`, - s.GetHistory(s.Namespace(), tv.WorkflowExecution())) + s.GetHistory(s.Namespace().String(), tv.WorkflowExecution())) } func (s *ClientMiscTestSuite) Test_StickyWorkerRestartWorkflowTask() { @@ -1142,7 +1141,7 @@ func (s *ClientMiscTestSuite) TestBatchSignal() { s.NoError(err) _, err = s.SdkClient().WorkflowService().StartBatchOperation(context.Background(), &workflowservice.StartBatchOperationRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Operation: &workflowservice.StartBatchOperationRequest_SignalOperation{ SignalOperation: &batchpb.BatchOperationSignal{ Signal: "my-signal", @@ -1205,7 +1204,7 @@ func (s *ClientMiscTestSuite) TestBatchReset() { count.Add(1) _, err = s.SdkClient().WorkflowService().StartBatchOperation(context.Background(), &workflowservice.StartBatchOperationRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Operation: &workflowservice.StartBatchOperationRequest_ResetOperation{ ResetOperation: &batchpb.BatchOperationReset{ ResetType: enumspb.RESET_TYPE_FIRST_WORKFLOW_TASK, @@ -1309,7 +1308,7 @@ func (s *ClientMiscTestSuite) TestBatchResetByBuildId() { s.NoError(err) ex := &commonpb.WorkflowExecution{WorkflowId: run.GetID(), RunId: run.GetRunID()} // wait for first wft and first activity to complete - s.Eventually(func() bool { return len(s.GetHistory(s.Namespace(), ex)) >= 10 }, 5*time.Second, 100*time.Millisecond) + s.Eventually(func() bool { return len(s.GetHistory(s.Namespace().String(), ex)) >= 10 }, 5*time.Second, 100*time.Millisecond) w1.Stop() @@ -1355,7 +1354,7 @@ func (s *ClientMiscTestSuite) TestBatchResetByBuildId() { searchattribute.BuildIds, worker_versioning.UnversionedBuildIdSearchAttribute(buildIdv2)) s.Eventually(func() bool { resp, err := s.FrontendClient().ListWorkflowExecutions(ctx, &workflowservice.ListWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Query: query, }) return err == nil && len(resp.Executions) == 1 @@ -1363,7 +1362,7 @@ func (s *ClientMiscTestSuite) TestBatchResetByBuildId() { // reset it using v2 as the bad build ID _, err = s.FrontendClient().StartBatchOperation(context.Background(), &workflowservice.StartBatchOperationRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), VisibilityQuery: query, JobId: uuid.New(), Reason: "test", diff --git a/tests/continue_as_new_test.go b/tests/continue_as_new_test.go index b2d2d6ae143..05087ec2524 100644 --- a/tests/continue_as_new_test.go +++ b/tests/continue_as_new_test.go @@ -83,7 +83,7 @@ func (s *ContinueAsNewTestSuite) TestContinueAsNewWorkflow() { request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -146,7 +146,7 @@ func (s *ContinueAsNewTestSuite) TestContinueAsNewWorkflow() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -184,7 +184,7 @@ func (s *ContinueAsNewTestSuite) TestContinueAsNewWorkflow() { s.Equal(we.RunId, lastRunStartedEventAttrs.GetFirstExecutionRunId()) descResp, err := s.FrontendClient().DescribeWorkflowExecution(testcore.NewContext(), &workflowservice.DescribeWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: &commonpb.WorkflowExecution{ WorkflowId: id, }, @@ -206,7 +206,7 @@ func (s *ContinueAsNewTestSuite) TestContinueAsNewRunTimeout() { request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -257,7 +257,7 @@ func (s *ContinueAsNewTestSuite) TestContinueAsNewRunTimeout() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -277,7 +277,7 @@ func (s *ContinueAsNewTestSuite) TestContinueAsNewRunTimeout() { var historyEvents []*historypb.HistoryEvent for i := 0; i < 20; i++ { - historyEvents = s.GetHistory(s.Namespace(), &commonpb.WorkflowExecution{ + historyEvents = s.GetHistory(s.Namespace().String(), &commonpb.WorkflowExecution{ WorkflowId: id, }) lastEvent := historyEvents[len(historyEvents)-1] @@ -309,7 +309,7 @@ func (s *ContinueAsNewTestSuite) TestContinueAsNewRunExecutionTimeout() { request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -339,7 +339,7 @@ func (s *ContinueAsNewTestSuite) TestContinueAsNewRunExecutionTimeout() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -368,7 +368,7 @@ func (s *ContinueAsNewTestSuite) TestContinueAsNewRunExecutionTimeout() { descResp, err := s.FrontendClient().DescribeWorkflowExecution( testcore.NewContext(), &workflowservice.DescribeWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: &commonpb.WorkflowExecution{ WorkflowId: id, }, @@ -397,7 +397,7 @@ func (s *ContinueAsNewTestSuite) TestWorkflowContinueAsNewTaskID() { request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -447,7 +447,7 @@ func (s *ContinueAsNewTestSuite) TestWorkflowContinueAsNewTaskID() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -458,7 +458,7 @@ func (s *ContinueAsNewTestSuite) TestWorkflowContinueAsNewTaskID() { minTaskID := int64(0) _, err := poller.PollAndProcessWorkflowTask() s.NoError(err) - events := s.GetHistory(s.Namespace(), executions[0]) + events := s.GetHistory(s.Namespace().String(), executions[0]) s.True(len(events) != 0) for _, event := range events { s.True(event.GetTaskId() > minTaskID) @@ -467,7 +467,7 @@ func (s *ContinueAsNewTestSuite) TestWorkflowContinueAsNewTaskID() { _, err = poller.PollAndProcessWorkflowTask() s.NoError(err) - events = s.GetHistory(s.Namespace(), executions[1]) + events = s.GetHistory(s.Namespace().String(), executions[1]) s.True(len(events) != 0) for _, event := range events { s.True(event.GetTaskId() > minTaskID) @@ -576,7 +576,7 @@ func (w *ParentWithChildContinueAsNew) workflow(task *workflowservice.PollWorkfl CommandType: enumspb.COMMAND_TYPE_START_CHILD_WORKFLOW_EXECUTION, Attributes: &commandpb.Command_StartChildWorkflowExecutionCommandAttributes{ StartChildWorkflowExecutionCommandAttributes: &commandpb.StartChildWorkflowExecutionCommandAttributes{ - Namespace: w.suite.Namespace(), + Namespace: w.suite.Namespace().String(), WorkflowId: w.childID, WorkflowType: w.childWorkflowType, Input: payloads.EncodeBytes(buf.Bytes()), @@ -630,7 +630,7 @@ func (s *ContinueAsNewTestSuite) TestChildWorkflowWithContinueAsNew() { request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: parentID, WorkflowType: definition.parentWorkflowType, TaskQueue: taskQueue, @@ -646,7 +646,7 @@ func (s *ContinueAsNewTestSuite) TestChildWorkflowWithContinueAsNew() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: identity, WorkflowTaskHandler: definition.workflow, @@ -692,7 +692,7 @@ func (s *ContinueAsNewTestSuite) TestChildWorkflowWithContinueAsNew() { s.NoError(err) s.NotNil(definition.completedEvent) completedAttributes := definition.completedEvent.GetChildWorkflowExecutionCompletedEventAttributes() - s.Equal(s.Namespace(), completedAttributes.Namespace) + s.Equal(s.Namespace().String(), completedAttributes.Namespace) // TODO: change to s.Equal(s.Namespace()ID) once it is available. s.NotEmpty(completedAttributes.Namespace) s.Equal(childID, completedAttributes.WorkflowExecution.WorkflowId) @@ -717,7 +717,7 @@ func (s *ContinueAsNewTestSuite) TestChildWorkflowWithContinueAsNew() { 11 WorkflowTaskScheduled 12 WorkflowTaskStarted 13 WorkflowTaskCompleted - 14 WorkflowExecutionCompleted`, s.GetHistory(s.Namespace(), &commonpb.WorkflowExecution{ + 14 WorkflowExecutionCompleted`, s.GetHistory(s.Namespace().String(), &commonpb.WorkflowExecution{ WorkflowId: parentID, RunId: we.RunId, })) @@ -744,7 +744,7 @@ func (s *ContinueAsNewTestSuite) TestChildWorkflowWithContinueAsNewParentTermina request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: parentID, WorkflowType: definition.parentWorkflowType, TaskQueue: taskQueue, @@ -760,7 +760,7 @@ func (s *ContinueAsNewTestSuite) TestChildWorkflowWithContinueAsNewParentTermina poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: identity, WorkflowTaskHandler: definition.workflow, @@ -789,7 +789,7 @@ func (s *ContinueAsNewTestSuite) TestChildWorkflowWithContinueAsNewParentTermina _, err = s.FrontendClient().TerminateWorkflowExecution( testcore.NewContext(), &workflowservice.TerminateWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: &commonpb.WorkflowExecution{ WorkflowId: parentID, }, @@ -800,7 +800,7 @@ func (s *ContinueAsNewTestSuite) TestChildWorkflowWithContinueAsNewParentTermina parentDescribeResp, err := s.FrontendClient().DescribeWorkflowExecution( testcore.NewContext(), &workflowservice.DescribeWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: &commonpb.WorkflowExecution{ WorkflowId: parentID, }, @@ -817,7 +817,7 @@ func (s *ContinueAsNewTestSuite) TestChildWorkflowWithContinueAsNewParentTermina childDescribeResp, err = s.FrontendClient().DescribeWorkflowExecution( testcore.NewContext(), &workflowservice.DescribeWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: &commonpb.WorkflowExecution{ WorkflowId: childID, }, @@ -849,14 +849,14 @@ func (s *ContinueAsNewTestSuite) TestChildWorkflowWithContinueAsNewParentTermina 7 WorkflowTaskScheduled 8 WorkflowTaskStarted 9 WorkflowTaskCompleted - 10 WorkflowExecutionTerminated`, s.GetHistory(s.Namespace(), &commonpb.WorkflowExecution{ + 10 WorkflowExecutionTerminated`, s.GetHistory(s.Namespace().String(), &commonpb.WorkflowExecution{ WorkflowId: parentID, RunId: we.RunId, })) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted - 2 WorkflowExecutionTerminated`, s.GetHistory(s.Namespace(), &commonpb.WorkflowExecution{ + 2 WorkflowExecutionTerminated`, s.GetHistory(s.Namespace().String(), &commonpb.WorkflowExecution{ WorkflowId: childID, })) } diff --git a/tests/cron_test.go b/tests/cron_test.go index 478eb56ec31..4cd4667378c 100644 --- a/tests/cron_test.go +++ b/tests/cron_test.go @@ -80,7 +80,7 @@ func (s *CronTestSuite) TestCronWorkflow_Failed_Infinite() { request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: &commonpb.WorkflowType{Name: wt}, TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, @@ -132,7 +132,7 @@ func (s *CronTestSuite) TestCronWorkflow_Failed_Infinite() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -172,7 +172,7 @@ func (s *CronTestSuite) TestCronWorkflow() { request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: &commonpb.WorkflowType{Name: wt}, TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, @@ -239,7 +239,7 @@ func (s *CronTestSuite) TestCronWorkflow() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -255,7 +255,7 @@ func (s *CronTestSuite) TestCronWorkflow() { // This will not cost extra time as the polling for first workflow task will be blocked for 3 seconds. time.Sleep(2 * time.Second) //nolint:forbidigo resp, err := s.FrontendClient().ListOpenWorkflowExecutions(testcore.NewContext(), &workflowservice.ListOpenWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), MaximumPageSize: 100, StartTimeFilter: startFilter, Filters: &workflowservice.ListOpenWorkflowExecutionsRequest_ExecutionFilter{ExecutionFilter: &filterpb.WorkflowExecutionFilter{ @@ -285,7 +285,7 @@ func (s *CronTestSuite) TestCronWorkflow() { s.Equal(3, len(executions)) _, terminateErr := s.FrontendClient().TerminateWorkflowExecution(testcore.NewContext(), &workflowservice.TerminateWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: &commonpb.WorkflowExecution{ WorkflowId: id, }, @@ -294,7 +294,7 @@ func (s *CronTestSuite) TestCronWorkflow() { // first two should be failures for i := 0; i < 2; i++ { - events := s.GetHistory(s.Namespace(), executions[i]) + events := s.GetHistory(s.Namespace().String(), executions[i]) s.EqualHistoryEvents(fmt.Sprintf(` 1 WorkflowExecutionStarted {"Memo":{"Fields":{"memoKey":{"Data":"\"memoVal\""}}},"SearchAttributes":{"IndexedFields":{"CustomKeywordField":{"Data":"\"keyword-value\"","Metadata":{"type":"Keyword"}}}}} 2 WorkflowTaskScheduled @@ -305,7 +305,7 @@ func (s *CronTestSuite) TestCronWorkflow() { } // third should be completed - events := s.GetHistory(s.Namespace(), executions[2]) + events := s.GetHistory(s.Namespace().String(), executions[2]) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted {"Memo":{"Fields":{"memoKey":{"Data":"\"memoVal\""}}},"SearchAttributes":{"IndexedFields":{"CustomKeywordField":{"Data":"\"keyword-value\"","Metadata":{"type":"Keyword"}}}}} 2 WorkflowTaskScheduled @@ -318,7 +318,7 @@ func (s *CronTestSuite) TestCronWorkflow() { var closedExecutions []*workflowpb.WorkflowExecutionInfo for i := 0; i < 10; i++ { resp, err := s.FrontendClient().ListClosedWorkflowExecutions(testcore.NewContext(), &workflowservice.ListClosedWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), MaximumPageSize: 100, StartTimeFilter: startFilter, Filters: &workflowservice.ListClosedWorkflowExecutionsRequest_ExecutionFilter{ExecutionFilter: &filterpb.WorkflowExecutionFilter{ @@ -334,7 +334,7 @@ func (s *CronTestSuite) TestCronWorkflow() { } s.NotNil(closedExecutions) dweResponse, err := s.FrontendClient().DescribeWorkflowExecution(testcore.NewContext(), &workflowservice.DescribeWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: &commonpb.WorkflowExecution{ WorkflowId: id, RunId: we.RunId, @@ -370,7 +370,7 @@ func (s *CronTestSuite) TestCronWorkflow() { // TODO: Remove the describeWorkflowExecution call when firstRunID in WorkflowExecutionInfo // is populated by Visibility api as well. dweResponse, err := s.FrontendClient().DescribeWorkflowExecution(testcore.NewContext(), &workflowservice.DescribeWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: executionInfo.GetExecution(), }) s.NoError(err) @@ -473,7 +473,7 @@ func (s *CronTestClientSuite) TestCronWorkflowCompletionStates() { exec := s.listOpenWorkflowExecutions(startTs, time.Now(), id, 1)[0] firstRunID := exec.GetExecution().RunId s.Equal(enumspb.WORKFLOW_EXECUTION_STATUS_RUNNING, exec.GetStatus()) - historyEvents := s.GetHistory(s.Namespace(), exec.GetExecution()) + historyEvents := s.GetHistory(s.Namespace().String(), exec.GetExecution()) s.EqualHistoryEvents(fmt.Sprintf(` 1 WorkflowExecutionStarted {"ContinuedExecutionRunId":"","CronSchedule":"@every 3s","FirstExecutionRunId":"%s", "Initiator":3}`, firstRunID), historyEvents) attrs1 := historyEvents[0].GetWorkflowExecutionStartedEventAttributes() @@ -495,7 +495,7 @@ func (s *CronTestClientSuite) TestCronWorkflowCompletionStates() { 250*time.Millisecond, ) s.Equal(enumspb.WORKFLOW_EXECUTION_STATUS_RUNNING, exec.GetStatus()) - historyEvents = s.GetHistory(s.Namespace(), exec.GetExecution()) + historyEvents = s.GetHistory(s.Namespace().String(), exec.GetExecution()) s.EqualHistoryEvents(fmt.Sprintf(` 1 WorkflowExecutionStarted {"ContinuedExecutionRunId":"%s","CronSchedule":"@every 3s","FirstExecutionRunId":"%s", "Initiator":%d}`, firstRunID, firstRunID, enumspb.CONTINUE_AS_NEW_INITIATOR_CRON_SCHEDULE), historyEvents) attrs2 := historyEvents[0].GetWorkflowExecutionStartedEventAttributes() @@ -533,7 +533,7 @@ func (s *CronTestClientSuite) TestCronWorkflowCompletionStates() { exec = closedExecutions[5] // first: success s.Equal(enumspb.WORKFLOW_EXECUTION_STATUS_COMPLETED, exec.GetStatus()) - historyEvents = s.GetHistory(s.Namespace(), exec.GetExecution()) + historyEvents = s.GetHistory(s.Namespace().String(), exec.GetExecution()) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted 2 WorkflowTaskScheduled @@ -543,7 +543,7 @@ func (s *CronTestClientSuite) TestCronWorkflowCompletionStates() { exec = closedExecutions[4] // second: fail s.Equal(enumspb.WORKFLOW_EXECUTION_STATUS_FAILED, exec.GetStatus()) - historyEvents = s.GetHistory(s.Namespace(), exec.GetExecution()) + historyEvents = s.GetHistory(s.Namespace().String(), exec.GetExecution()) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted 2 WorkflowTaskScheduled @@ -553,7 +553,7 @@ func (s *CronTestClientSuite) TestCronWorkflowCompletionStates() { exec = closedExecutions[3] // third: timed out s.Equal(enumspb.WORKFLOW_EXECUTION_STATUS_TIMED_OUT, exec.GetStatus()) - historyEvents = s.GetHistory(s.Namespace(), exec.GetExecution()) + historyEvents = s.GetHistory(s.Namespace().String(), exec.GetExecution()) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted 2 WorkflowTaskScheduled @@ -564,7 +564,7 @@ func (s *CronTestClientSuite) TestCronWorkflowCompletionStates() { exec = closedExecutions[2] // fourth: success s.Equal(enumspb.WORKFLOW_EXECUTION_STATUS_COMPLETED, exec.GetStatus()) - historyEvents = s.GetHistory(s.Namespace(), exec.GetExecution()) + historyEvents = s.GetHistory(s.Namespace().String(), exec.GetExecution()) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted 2 WorkflowTaskScheduled @@ -574,7 +574,7 @@ func (s *CronTestClientSuite) TestCronWorkflowCompletionStates() { exec = closedExecutions[1] // fifth: success s.Equal(enumspb.WORKFLOW_EXECUTION_STATUS_COMPLETED, exec.GetStatus()) - historyEvents = s.GetHistory(s.Namespace(), exec.GetExecution()) + historyEvents = s.GetHistory(s.Namespace().String(), exec.GetExecution()) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted 2 WorkflowTaskScheduled @@ -584,7 +584,7 @@ func (s *CronTestClientSuite) TestCronWorkflowCompletionStates() { exec = closedExecutions[0] // sixth: terminated s.Equal(enumspb.WORKFLOW_EXECUTION_STATUS_TERMINATED, exec.GetStatus()) - events := s.GetHistory(s.Namespace(), exec.GetExecution()) + events := s.GetHistory(s.Namespace().String(), exec.GetExecution()) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted 2 WorkflowExecutionTerminated {"Reason":"test is over"}`, events) @@ -598,7 +598,7 @@ func (s *CronTestClientSuite) listOpenWorkflowExecutions(start, end time.Time, i var err error resp, err = s.SdkClient().ListOpenWorkflow( testcore.NewContext(), &workflowservice.ListOpenWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), MaximumPageSize: int32(2 * expectedNumber), StartTimeFilter: &filterpb.StartTimeFilter{ EarliestTime: timestamppb.New(start), @@ -632,7 +632,7 @@ func (s *CronTestClientSuite) listClosedWorkflowExecutions(start, end time.Time, resp, err = s.SdkClient().ListClosedWorkflow( testcore.NewContext(), &workflowservice.ListClosedWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), MaximumPageSize: int32(2 * expectedNumber), StartTimeFilter: &filterpb.StartTimeFilter{ EarliestTime: timestamppb.New(start), diff --git a/tests/deployment_test.go b/tests/deployment_test.go index 84e3e7fa07d..80c13331c37 100644 --- a/tests/deployment_test.go +++ b/tests/deployment_test.go @@ -121,7 +121,7 @@ func (s *DeploymentSuite) SetupTest() { s.setAssertions() sdkClient, err := sdkclient.Dial(sdkclient.Options{ HostPort: s.FrontendGRPCAddress(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), }) if err != nil { s.Logger.Fatal("Error when creating SDK client", tag.Error(err)) @@ -139,7 +139,7 @@ func (s *DeploymentSuite) TearDownTest() { func (s *DeploymentSuite) pollFromDeployment(ctx context.Context, taskQueue *taskqueuepb.TaskQueue, deployment *deploymentpb.Deployment) { _, _ = s.FrontendClient().PollWorkflowTaskQueue(ctx, &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: "random", WorkerVersionCapabilities: &commonpb.WorkerVersionCapabilities{ @@ -153,7 +153,7 @@ func (s *DeploymentSuite) pollFromDeployment(ctx context.Context, taskQueue *tas func (s *DeploymentSuite) pollActivityFromDeployment(ctx context.Context, taskQueue *taskqueuepb.TaskQueue, deployment *deploymentpb.Deployment) { _, _ = s.FrontendClient().PollActivityTaskQueue(ctx, &workflowservice.PollActivityTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: "random", WorkerVersionCapabilities: &commonpb.WorkerVersionCapabilities{ @@ -188,7 +188,7 @@ func (s *DeploymentSuite) TestDescribeDeployment_RegisterTaskQueue() { a := assert.New(t) resp, err := s.FrontendClient().DescribeDeployment(ctx, &workflowservice.DescribeDeploymentRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Deployment: workerDeployment, }) a.NoError(err) @@ -213,7 +213,7 @@ func (s *DeploymentSuite) TestDescribeDeployment_RegisterTaskQueue_ConcurrentPol tv := testvars.New(s) d := tv.Deployment() - root, err := tqid.PartitionFromProto(tv.TaskQueue(), s.Namespace(), enumspb.TASK_QUEUE_TYPE_WORKFLOW) + root, err := tqid.PartitionFromProto(tv.TaskQueue(), s.Namespace().String(), enumspb.TASK_QUEUE_TYPE_WORKFLOW) s.NoError(err) // Making concurrent polls to 4 partitions, 3 polls to each for p := 0; p < 4; p++ { @@ -229,7 +229,7 @@ func (s *DeploymentSuite) TestDescribeDeployment_RegisterTaskQueue_ConcurrentPol a := assert.New(t) resp, err := s.FrontendClient().DescribeDeployment(ctx, &workflowservice.DescribeDeploymentRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Deployment: d, }) if !a.NoError(err) { @@ -265,7 +265,7 @@ func (s *DeploymentSuite) TestGetCurrentDeployment_NoCurrentDeployment() { // GetCurrentDeployment on a non-existing series returns an error resp, err := s.FrontendClient().GetCurrentDeployment(ctx, &workflowservice.GetCurrentDeploymentRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), SeriesName: seriesName, }) s.Error(err) @@ -280,7 +280,7 @@ func (s *DeploymentSuite) TestGetCurrentDeployment_NoCurrentDeployment() { a := assert.New(t) resp, err := s.FrontendClient().CountWorkflowExecutions(ctx, &workflowservice.CountWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Query: query, }) a.NoError(err) @@ -289,7 +289,7 @@ func (s *DeploymentSuite) TestGetCurrentDeployment_NoCurrentDeployment() { // Fetch series workflow's current deployment - will be nil since we haven't set it resp, err = s.FrontendClient().GetCurrentDeployment(ctx, &workflowservice.GetCurrentDeploymentRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), SeriesName: seriesName, }) s.NoError(err) @@ -377,7 +377,7 @@ func (s *DeploymentSuite) startDeploymentsAndValidateList(deploymentInfo []*depl var expectedDeployments []*deploymentpb.DeploymentListInfo request := &workflowservice.ListDeploymentsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), PageSize: pageSize, } if seriesFilter != "" { @@ -480,7 +480,7 @@ func (s *DeploymentSuite) TestGetDeploymentReachability_OverrideUnversioned() { }, } updateResp, err := s.FrontendClient().UpdateWorkflowExecutionOptions(ctx, &workflowservice.UpdateWorkflowExecutionOptionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: unversionedWFExec, WorkflowExecutionOptions: updateOpts, UpdateMask: &fieldmaskpb.FieldMask{Paths: []string{"versioning_override"}}, @@ -508,7 +508,7 @@ func (s *DeploymentSuite) TestGetDeploymentReachability_NotFound() { seriesName := testcore.RandomizeStr("my-series|:|:") buildID := testcore.RandomizeStr("bgt:|") resp, err := s.FrontendClient().GetDeploymentReachability(ctx, &workflowservice.GetDeploymentReachabilityRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Deployment: &deploymentpb.Deployment{ SeriesName: seriesName, BuildId: buildID, @@ -528,7 +528,7 @@ func (s *DeploymentSuite) checkDescribeWorkflowAfterOverride( s.EventuallyWithT(func(t *assert.CollectT) { a := assert.New(t) resp, err := s.FrontendClient().DescribeWorkflowExecution(ctx, &workflowservice.DescribeWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: wf, }) a.NoError(err) @@ -546,7 +546,7 @@ func (s *DeploymentSuite) checkDeploymentReachability( s.EventuallyWithT(func(t *assert.CollectT) { a := assert.New(t) resp, err := s.FrontendClient().GetDeploymentReachability(ctx, &workflowservice.GetDeploymentReachabilityRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Deployment: deploy, }) a.NoError(err) @@ -567,7 +567,7 @@ func (s *DeploymentSuite) createDeploymentAndWaitForExist( a := assert.New(t) resp, err := s.FrontendClient().DescribeDeployment(ctx, &workflowservice.DescribeDeploymentRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Deployment: deployment, }) a.NoError(err) @@ -596,7 +596,7 @@ func (s *DeploymentSuite) TestUpdateWorkflowExecutionOptions_SetUnpinnedThenUnse // 1. Set unpinned override --> describe workflow shows the override updateResp, err := s.FrontendClient().UpdateWorkflowExecutionOptions(ctx, &workflowservice.UpdateWorkflowExecutionOptionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: unversionedWFExec, WorkflowExecutionOptions: unpinnedOpts, UpdateMask: &fieldmaskpb.FieldMask{Paths: []string{"versioning_override"}}, @@ -607,7 +607,7 @@ func (s *DeploymentSuite) TestUpdateWorkflowExecutionOptions_SetUnpinnedThenUnse // 2. Unset using empty update opts with mutation mask --> describe workflow shows no more override updateResp, err = s.FrontendClient().UpdateWorkflowExecutionOptions(ctx, &workflowservice.UpdateWorkflowExecutionOptionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: unversionedWFExec, WorkflowExecutionOptions: &workflowpb.WorkflowExecutionOptions{}, UpdateMask: &fieldmaskpb.FieldMask{Paths: []string{"versioning_override"}}, @@ -651,7 +651,7 @@ func (s *DeploymentSuite) TestUpdateWorkflowExecutionOptions_SetPinnedThenUnset( // 1. Set pinned override on our new unversioned workflow --> describe workflow shows the override + deployment is reachable updateResp, err := s.FrontendClient().UpdateWorkflowExecutionOptions(ctx, &workflowservice.UpdateWorkflowExecutionOptionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: unversionedWFExec, WorkflowExecutionOptions: pinnedOpts, UpdateMask: &fieldmaskpb.FieldMask{Paths: []string{"versioning_override"}}, @@ -663,7 +663,7 @@ func (s *DeploymentSuite) TestUpdateWorkflowExecutionOptions_SetPinnedThenUnset( // 2. Unset with empty update opts with mutation mask --> describe workflow shows no more override + deployment is unreachable updateResp, err = s.FrontendClient().UpdateWorkflowExecutionOptions(ctx, &workflowservice.UpdateWorkflowExecutionOptionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: unversionedWFExec, WorkflowExecutionOptions: &workflowpb.WorkflowExecutionOptions{}, UpdateMask: &fieldmaskpb.FieldMask{Paths: []string{"versioning_override"}}, @@ -704,7 +704,7 @@ func (s *DeploymentSuite) TestUpdateWorkflowExecutionOptions_EmptyFields() { // 1. Pinned update with empty mask --> describe workflow shows no change updateResp, err := s.FrontendClient().UpdateWorkflowExecutionOptions(ctx, &workflowservice.UpdateWorkflowExecutionOptionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: unversionedWFExec, WorkflowExecutionOptions: pinnedOpts, UpdateMask: &fieldmaskpb.FieldMask{Paths: []string{}}, @@ -756,7 +756,7 @@ func (s *DeploymentSuite) TestUpdateWorkflowExecutionOptions_SetPinnedSetPinned( // 1. Set pinned override 1 --> describe workflow shows the override + deployment 1 is reachable updateResp, err := s.FrontendClient().UpdateWorkflowExecutionOptions(ctx, &workflowservice.UpdateWorkflowExecutionOptionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: unversionedWFExec, WorkflowExecutionOptions: pinnedOpts1, UpdateMask: &fieldmaskpb.FieldMask{Paths: []string{"versioning_override"}}, @@ -769,7 +769,7 @@ func (s *DeploymentSuite) TestUpdateWorkflowExecutionOptions_SetPinnedSetPinned( // 3. Set pinned override 2 --> describe workflow shows the override + deployment 2 is reachable, 1 unreachable updateResp, err = s.FrontendClient().UpdateWorkflowExecutionOptions(ctx, &workflowservice.UpdateWorkflowExecutionOptionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: unversionedWFExec, WorkflowExecutionOptions: pinnedOpts2, UpdateMask: &fieldmaskpb.FieldMask{Paths: []string{"versioning_override"}}, @@ -804,7 +804,7 @@ func (s *DeploymentSuite) TestUpdateWorkflowExecutionOptions_SetUnpinnedSetUnpin // 1. Set unpinned override --> describe workflow shows the override updateResp, err := s.FrontendClient().UpdateWorkflowExecutionOptions(ctx, &workflowservice.UpdateWorkflowExecutionOptionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: unversionedWFExec, WorkflowExecutionOptions: unpinnedOpts, UpdateMask: &fieldmaskpb.FieldMask{Paths: []string{"versioning_override"}}, @@ -815,7 +815,7 @@ func (s *DeploymentSuite) TestUpdateWorkflowExecutionOptions_SetUnpinnedSetUnpin // 1. Set unpinned override --> describe workflow shows the override updateResp, err = s.FrontendClient().UpdateWorkflowExecutionOptions(ctx, &workflowservice.UpdateWorkflowExecutionOptionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: unversionedWFExec, WorkflowExecutionOptions: unpinnedOpts, UpdateMask: &fieldmaskpb.FieldMask{Paths: []string{"versioning_override"}}, @@ -863,7 +863,7 @@ func (s *DeploymentSuite) TestUpdateWorkflowExecutionOptions_SetUnpinnedSetPinne // 1. Set unpinned override --> describe workflow shows the override + deployment1 is unreachable updateResp, err := s.FrontendClient().UpdateWorkflowExecutionOptions(ctx, &workflowservice.UpdateWorkflowExecutionOptionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: unversionedWFExec, WorkflowExecutionOptions: unpinnedOpts, UpdateMask: &fieldmaskpb.FieldMask{Paths: []string{"versioning_override"}}, @@ -875,7 +875,7 @@ func (s *DeploymentSuite) TestUpdateWorkflowExecutionOptions_SetUnpinnedSetPinne // 1. Set pinned override 1 --> describe workflow shows the override + deployment1 is reachable updateResp, err = s.FrontendClient().UpdateWorkflowExecutionOptions(ctx, &workflowservice.UpdateWorkflowExecutionOptionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: unversionedWFExec, WorkflowExecutionOptions: pinnedOpts1, UpdateMask: &fieldmaskpb.FieldMask{Paths: []string{"versioning_override"}}, @@ -923,7 +923,7 @@ func (s *DeploymentSuite) TestUpdateWorkflowExecutionOptions_SetPinnedSetUnpinne // 1. Set pinned override 1 --> describe workflow shows the override + deployment1 is reachable updateResp, err := s.FrontendClient().UpdateWorkflowExecutionOptions(ctx, &workflowservice.UpdateWorkflowExecutionOptionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: unversionedWFExec, WorkflowExecutionOptions: pinnedOpts1, UpdateMask: &fieldmaskpb.FieldMask{Paths: []string{"versioning_override"}}, @@ -935,7 +935,7 @@ func (s *DeploymentSuite) TestUpdateWorkflowExecutionOptions_SetPinnedSetUnpinne // 1. Set unpinned override --> describe workflow shows the override + deployment1 is unreachable updateResp, err = s.FrontendClient().UpdateWorkflowExecutionOptions(ctx, &workflowservice.UpdateWorkflowExecutionOptionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: unversionedWFExec, WorkflowExecutionOptions: unpinnedOpts, UpdateMask: &fieldmaskpb.FieldMask{Paths: []string{"versioning_override"}}, @@ -986,7 +986,7 @@ func (s *DeploymentSuite) TestBatchUpdateWorkflowExecutionOptions_SetPinnedThenU // start batch update-options operation batchJobId := uuid.New() err := s.startBatchJobWithinConcurrentJobLimit(ctx, &workflowservice.StartBatchOperationRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), JobId: batchJobId, Reason: "test", Executions: workflows, @@ -1014,7 +1014,7 @@ func (s *DeploymentSuite) TestBatchUpdateWorkflowExecutionOptions_SetPinnedThenU // unset with empty update opts with mutation mask batchJobId = uuid.New() err = s.startBatchJobWithinConcurrentJobLimit(ctx, &workflowservice.StartBatchOperationRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), JobId: batchJobId, Reason: "test", Executions: workflows, @@ -1058,7 +1058,7 @@ func (s *DeploymentSuite) checkListAndWaitForBatchCompletion(ctx context.Context s.EventuallyWithT(func(t *assert.CollectT) { a := assert.New(t) listResp, err := s.FrontendClient().ListBatchOperations(ctx, &workflowservice.ListBatchOperationsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), }) a.NoError(err) a.Greater(len(listResp.GetOperationInfo()), 0) @@ -1069,7 +1069,7 @@ func (s *DeploymentSuite) checkListAndWaitForBatchCompletion(ctx context.Context for { descResp, err := s.FrontendClient().DescribeBatchOperation(ctx, &workflowservice.DescribeBatchOperationRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), JobId: jobId, }) s.NoError(err) @@ -1099,7 +1099,7 @@ func (s *DeploymentSuite) TestStartWorkflowExecution_WithPinnedOverride() { s.createDeploymentAndWaitForExist(ctx, deploymentA, &taskqueuepb.TaskQueue{Name: "test-tq", Kind: enumspb.TASK_QUEUE_KIND_NORMAL}) resp, err := s.FrontendClient().StartWorkflowExecution(ctx, &workflowservice.StartWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: "test-workflow-id1", WorkflowType: &commonpb.WorkflowType{Name: "test-wf-type"}, TaskQueue: &taskqueuepb.TaskQueue{Name: "test-tq", Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, @@ -1128,7 +1128,7 @@ func (s *DeploymentSuite) TestStartWorkflowExecution_WithUnpinnedOverride() { } resp, err := s.FrontendClient().StartWorkflowExecution(ctx, &workflowservice.StartWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: "test-workflow-id2", WorkflowType: &commonpb.WorkflowType{Name: "test-wf-type"}, TaskQueue: &taskqueuepb.TaskQueue{Name: "test-tq", Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, @@ -1164,7 +1164,7 @@ func (s *DeploymentSuite) TestSignalWithStartWorkflowExecution_WithPinnedOverrid s.createDeploymentAndWaitForExist(ctx, deploymentA, &taskqueuepb.TaskQueue{Name: "test-tq", Kind: enumspb.TASK_QUEUE_KIND_NORMAL}) resp, err := s.FrontendClient().SignalWithStartWorkflowExecution(ctx, &workflowservice.SignalWithStartWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: "test-workflow-id3", WorkflowType: &commonpb.WorkflowType{Name: "test-wf-type"}, TaskQueue: &taskqueuepb.TaskQueue{Name: "test-tq", Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, @@ -1196,7 +1196,7 @@ func (s *DeploymentSuite) TestSignalWithStartWorkflowExecution_WithUnpinnedOverr } resp, err := s.FrontendClient().SignalWithStartWorkflowExecution(ctx, &workflowservice.SignalWithStartWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: "test-workflow-id4", WorkflowType: &commonpb.WorkflowType{Name: "test-wf-type"}, TaskQueue: &taskqueuepb.TaskQueue{Name: "test-tq", Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, @@ -1234,7 +1234,7 @@ func (s *DeploymentSuite) TestSetCurrent_BeforeAndAfterRegister() { // set to 1 res, err := s.FrontendClient().SetCurrentDeployment(ctx, &workflowservice.SetCurrentDeploymentRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Deployment: dep1, Identity: "test", }) @@ -1245,7 +1245,7 @@ func (s *DeploymentSuite) TestSetCurrent_BeforeAndAfterRegister() { // describe 1 should say it's current (no delay) desc, err := s.FrontendClient().DescribeDeployment(ctx, &workflowservice.DescribeDeploymentRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Deployment: dep1, }) s.NoError(err) @@ -1253,7 +1253,7 @@ func (s *DeploymentSuite) TestSetCurrent_BeforeAndAfterRegister() { // get current should return 1 (no delay) cur, err := s.FrontendClient().GetCurrentDeployment(ctx, &workflowservice.GetCurrentDeploymentRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), SeriesName: tv.DeploymentSeries(), }) s.NoError(err) @@ -1263,7 +1263,7 @@ func (s *DeploymentSuite) TestSetCurrent_BeforeAndAfterRegister() { s.EventuallyWithT(func(t *assert.CollectT) { a := assert.New(t) list, err := s.FrontendClient().ListDeployments(ctx, &workflowservice.ListDeploymentsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), }) a.NoError(err) found, isCurrent1 := 0, false @@ -1279,7 +1279,7 @@ func (s *DeploymentSuite) TestSetCurrent_BeforeAndAfterRegister() { // now set to 2 res, err = s.FrontendClient().SetCurrentDeployment(ctx, &workflowservice.SetCurrentDeploymentRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Deployment: dep2, Identity: "test", }) @@ -1291,7 +1291,7 @@ func (s *DeploymentSuite) TestSetCurrent_BeforeAndAfterRegister() { // describe 1 should say it's not current (no delay) desc, err = s.FrontendClient().DescribeDeployment(ctx, &workflowservice.DescribeDeploymentRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Deployment: dep1, }) s.NoError(err) @@ -1299,7 +1299,7 @@ func (s *DeploymentSuite) TestSetCurrent_BeforeAndAfterRegister() { // describe 2 should say it's not current (no delay) desc, err = s.FrontendClient().DescribeDeployment(ctx, &workflowservice.DescribeDeploymentRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Deployment: dep2, }) s.NoError(err) @@ -1307,7 +1307,7 @@ func (s *DeploymentSuite) TestSetCurrent_BeforeAndAfterRegister() { // get current should return 2 (no delay) cur, err = s.FrontendClient().GetCurrentDeployment(ctx, &workflowservice.GetCurrentDeploymentRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), SeriesName: tv.DeploymentSeries(), }) s.NoError(err) @@ -1317,7 +1317,7 @@ func (s *DeploymentSuite) TestSetCurrent_BeforeAndAfterRegister() { s.EventuallyWithT(func(t *assert.CollectT) { a := assert.New(t) list, err := s.FrontendClient().ListDeployments(ctx, &workflowservice.ListDeploymentsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), }) a.NoError(err) found, isCurrent1, isCurrent2 := 0, false, false @@ -1353,7 +1353,7 @@ func (s *DeploymentSuite) TestSetCurrent_UpdateMetadata() { // set to 1 with some metadata _, err := s.FrontendClient().SetCurrentDeployment(ctx, &workflowservice.SetCurrentDeploymentRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Deployment: dep1, Identity: "test", UpdateMetadata: &deploymentpb.UpdateDeploymentMetadata{ @@ -1368,7 +1368,7 @@ func (s *DeploymentSuite) TestSetCurrent_UpdateMetadata() { // set to 2 _, err = s.FrontendClient().SetCurrentDeployment(ctx, &workflowservice.SetCurrentDeploymentRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Deployment: dep2, Identity: "test", }) @@ -1376,7 +1376,7 @@ func (s *DeploymentSuite) TestSetCurrent_UpdateMetadata() { // set back to 1 with different metadata _, err = s.FrontendClient().SetCurrentDeployment(ctx, &workflowservice.SetCurrentDeploymentRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Deployment: dep1, Identity: "test", UpdateMetadata: &deploymentpb.UpdateDeploymentMetadata{ @@ -1390,7 +1390,7 @@ func (s *DeploymentSuite) TestSetCurrent_UpdateMetadata() { s.NoError(err) cur, err := s.FrontendClient().GetCurrentDeployment(ctx, &workflowservice.GetCurrentDeploymentRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), SeriesName: tv.DeploymentSeries(), }) s.NoError(err) diff --git a/tests/describe_task_queue_test.go b/tests/describe_task_queue_test.go index 9b19fde370f..c48d97b79a2 100644 --- a/tests/describe_task_queue_test.go +++ b/tests/describe_task_queue_test.go @@ -72,7 +72,7 @@ func (s *DescribeTaskQueueSuite) SetupTest() { func (s *DescribeTaskQueueSuite) TestNonRootLegacy() { resp, err := s.FrontendClient().DescribeTaskQueue(context.Background(), &workflowservice.DescribeTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{Name: "/_sys/foo/1", Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, ApiMode: enumspb.DESCRIBE_TASK_QUEUE_MODE_UNSPECIFIED, }) @@ -150,7 +150,7 @@ func (s *DescribeTaskQueueSuite) publishConsumeWorkflowTasksValidateStats(workfl request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: workflowType, TaskQueue: tq, @@ -174,7 +174,7 @@ func (s *DescribeTaskQueueSuite) publishConsumeWorkflowTasksValidateStats(workfl // Poll the tasks for i := 0; i < workflows; { resp1, err1 := s.FrontendClient().PollWorkflowTaskQueue(testcore.NewContext(), &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tq, Identity: identity, }) @@ -184,7 +184,7 @@ func (s *DescribeTaskQueueSuite) publishConsumeWorkflowTasksValidateStats(workfl } i++ _, err := s.FrontendClient().RespondWorkflowTaskCompleted(testcore.NewContext(), &workflowservice.RespondWorkflowTaskCompletedRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Identity: identity, TaskToken: resp1.TaskToken, Commands: []*commandpb.Command{ @@ -221,7 +221,7 @@ func (s *DescribeTaskQueueSuite) publishConsumeWorkflowTasksValidateStats(workfl for i := 0; i < workflows; { resp1, err1 := s.FrontendClient().PollActivityTaskQueue( testcore.NewContext(), &workflowservice.PollActivityTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tq, Identity: identity, }, @@ -259,7 +259,7 @@ func (s *DescribeTaskQueueSuite) validateDescribeTaskQueue( if isEnhancedMode { if isCached { resp, err = s.FrontendClient().DescribeTaskQueue(ctx, &workflowservice.DescribeTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{Name: tq, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, ApiMode: enumspb.DESCRIBE_TASK_QUEUE_MODE_ENHANCED, Versions: nil, // default version, in this case unversioned queue @@ -294,7 +294,7 @@ func (s *DescribeTaskQueueSuite) validateDescribeTaskQueue( } else { s.EventuallyWithT(func(t *assert.CollectT) { resp, err = s.FrontendClient().DescribeTaskQueue(ctx, &workflowservice.DescribeTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{Name: tq, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, ApiMode: enumspb.DESCRIBE_TASK_QUEUE_MODE_ENHANCED, Versions: nil, // default version, in this case unversioned queue @@ -334,7 +334,7 @@ func (s *DescribeTaskQueueSuite) validateDescribeTaskQueue( // Querying the Legacy API s.Eventually(func() bool { resp, err = s.FrontendClient().DescribeTaskQueue(ctx, &workflowservice.DescribeTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{Name: tq, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, ApiMode: enumspb.DESCRIBE_TASK_QUEUE_MODE_UNSPECIFIED, IncludeTaskQueueStatus: true, @@ -354,7 +354,7 @@ func (s *DescribeTaskQueueSuite) validateDescribeTaskQueuePartition(tqName strin resp, err := s.GetTestCluster().MatchingClient().DescribeTaskQueuePartition( context.Background(), &matchingservice.DescribeTaskQueuePartitionRequest{ - NamespaceId: s.GetNamespaceID(s.Namespace()), + NamespaceId: s.NamespaceID().String(), TaskQueuePartition: &taskqueuespb.TaskQueuePartition{ TaskQueue: tqName, TaskQueueType: enumspb.TASK_QUEUE_TYPE_WORKFLOW, // since we have only workflow tasks @@ -413,7 +413,7 @@ func (s *DescribeTaskQueueSuite) publishConsumeWorkflowTasksValidateStatsCached( request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: workflowType, TaskQueue: tq, @@ -442,7 +442,7 @@ func (s *DescribeTaskQueueSuite) publishConsumeWorkflowTasksValidateStatsCached( // Poll the tasks for i := 0; i < workflows; { resp1, err1 := s.FrontendClient().PollWorkflowTaskQueue(testcore.NewContext(), &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tq, Identity: identity, }) diff --git a/tests/describe_test.go b/tests/describe_test.go index 3f1c980ed3b..f5493da44f6 100644 --- a/tests/describe_test.go +++ b/tests/describe_test.go @@ -63,7 +63,7 @@ func (s *DescribeTestSuite) TestDescribeWorkflowExecution() { // Start workflow execution request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: &commonpb.WorkflowType{Name: wt}, TaskQueue: &taskqueuepb.TaskQueue{Name: tq, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, @@ -80,7 +80,7 @@ func (s *DescribeTestSuite) TestDescribeWorkflowExecution() { describeWorkflowExecution := func() (*workflowservice.DescribeWorkflowExecutionResponse, error) { return s.FrontendClient().DescribeWorkflowExecution(testcore.NewContext(), &workflowservice.DescribeWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: &commonpb.WorkflowExecution{ WorkflowId: id, RunId: we.RunId, @@ -146,7 +146,7 @@ func (s *DescribeTestSuite) TestDescribeWorkflowExecution() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{Name: tq, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -209,7 +209,7 @@ func (s *DescribeTestSuite) TestDescribeTaskQueue() { // Start workflow execution request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: workflowID, WorkflowType: &commonpb.WorkflowType{Name: wt}, TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, @@ -263,7 +263,7 @@ func (s *DescribeTestSuite) TestDescribeTaskQueue() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -288,16 +288,16 @@ func (s *DescribeTestSuite) TestDescribeTaskQueue() { // when no one polling on the taskqueue (activity or workflow), there shall be no poller information tq := &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL} - pollerInfos := testDescribeTaskQueue(s.Namespace(), tq, enumspb.TASK_QUEUE_TYPE_ACTIVITY) + pollerInfos := testDescribeTaskQueue(s.Namespace().String(), tq, enumspb.TASK_QUEUE_TYPE_ACTIVITY) s.Empty(pollerInfos) - pollerInfos = testDescribeTaskQueue(s.Namespace(), tq, enumspb.TASK_QUEUE_TYPE_WORKFLOW) + pollerInfos = testDescribeTaskQueue(s.Namespace().String(), tq, enumspb.TASK_QUEUE_TYPE_WORKFLOW) s.Empty(pollerInfos) _, errWorkflowTask := poller.PollAndProcessWorkflowTask() s.NoError(errWorkflowTask) - pollerInfos = testDescribeTaskQueue(s.Namespace(), tq, enumspb.TASK_QUEUE_TYPE_ACTIVITY) + pollerInfos = testDescribeTaskQueue(s.Namespace().String(), tq, enumspb.TASK_QUEUE_TYPE_ACTIVITY) s.Empty(pollerInfos) - pollerInfos = testDescribeTaskQueue(s.Namespace(), tq, enumspb.TASK_QUEUE_TYPE_WORKFLOW) + pollerInfos = testDescribeTaskQueue(s.Namespace().String(), tq, enumspb.TASK_QUEUE_TYPE_WORKFLOW) s.Equal(1, len(pollerInfos)) s.Equal(identity, pollerInfos[0].GetIdentity()) s.True(pollerInfos[0].GetLastAccessTime().AsTime().After(before)) @@ -305,12 +305,12 @@ func (s *DescribeTestSuite) TestDescribeTaskQueue() { errActivity := poller.PollAndProcessActivityTask(false) s.NoError(errActivity) - pollerInfos = testDescribeTaskQueue(s.Namespace(), tq, enumspb.TASK_QUEUE_TYPE_ACTIVITY) + pollerInfos = testDescribeTaskQueue(s.Namespace().String(), tq, enumspb.TASK_QUEUE_TYPE_ACTIVITY) s.Equal(1, len(pollerInfos)) s.Equal(identity, pollerInfos[0].GetIdentity()) s.True(pollerInfos[0].GetLastAccessTime().AsTime().After(before)) s.NotEmpty(pollerInfos[0].GetLastAccessTime()) - pollerInfos = testDescribeTaskQueue(s.Namespace(), tq, enumspb.TASK_QUEUE_TYPE_WORKFLOW) + pollerInfos = testDescribeTaskQueue(s.Namespace().String(), tq, enumspb.TASK_QUEUE_TYPE_WORKFLOW) s.Equal(1, len(pollerInfos)) s.Equal(identity, pollerInfos[0].GetIdentity()) s.True(pollerInfos[0].GetLastAccessTime().AsTime().After(before)) diff --git a/tests/dlq_test.go b/tests/dlq_test.go index 343d8eb589d..413bf702311 100644 --- a/tests/dlq_test.go +++ b/tests/dlq_test.go @@ -170,7 +170,7 @@ func (s *DLQSuite) SetupSuite() { ) sdkClient, err := sdkclient.Dial(sdkclient.Options{ HostPort: s.FrontendGRPCAddress(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), }) s.NoError(err) s.worker = sdkworker.New(sdkClient, taskQueue, sdkworker.Options{}) @@ -516,7 +516,7 @@ func (s *DLQSuite) verifyRunIsInDLQ( func (s *DLQSuite) executeWorkflow(ctx context.Context, workflowID string) sdkclient.WorkflowRun { sdkClient, err := sdkclient.Dial(sdkclient.Options{ HostPort: s.FrontendGRPCAddress(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), }) s.NoError(err) diff --git a/tests/eager_workflow_start_test.go b/tests/eager_workflow_start_test.go index 36ff59a8e66..a02c5029c37 100644 --- a/tests/eager_workflow_start_test.go +++ b/tests/eager_workflow_start_test.go @@ -67,7 +67,7 @@ func (s *EagerWorkflowTestSuite) startEagerWorkflow(baseOptions *workflowservice options.RequestEagerExecution = true if options.GetNamespace() == "" { - options.Namespace = s.Namespace() + options.Namespace = s.Namespace().String() } if options.Identity == "" { options.Identity = "test" @@ -96,7 +96,7 @@ func (s *EagerWorkflowTestSuite) respondWorkflowTaskCompleted(task *workflowserv payloads, err := dataConverter.ToPayloads(result) s.Require().NoError(err) completion := workflowservice.RespondWorkflowTaskCompletedRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Identity: "test", TaskToken: task.TaskToken, Commands: []*commandpb.Command{{CommandType: enumspb.COMMAND_TYPE_COMPLETE_WORKFLOW_EXECUTION, Attributes: &commandpb.Command_CompleteWorkflowExecutionCommandAttributes{ @@ -111,7 +111,7 @@ func (s *EagerWorkflowTestSuite) respondWorkflowTaskCompleted(task *workflowserv func (s *EagerWorkflowTestSuite) pollWorkflowTaskQueue() *workflowservice.PollWorkflowTaskQueueResponse { task, err := s.FrontendClient().PollWorkflowTaskQueue(testcore.NewContext(), &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: s.defaultTaskQueue(), Identity: "test", }) @@ -121,7 +121,7 @@ func (s *EagerWorkflowTestSuite) pollWorkflowTaskQueue() *workflowservice.PollWo } func (s *EagerWorkflowTestSuite) getWorkflowStringResult(workflowID, runID string) string { - c, err := client.Dial(client.Options{HostPort: s.FrontendGRPCAddress(), Namespace: s.Namespace()}) + c, err := client.Dial(client.Options{HostPort: s.FrontendGRPCAddress(), Namespace: s.Namespace().String()}) s.Require().NoError(err) run := c.GetWorkflow(testcore.NewContext(), workflowID, runID) var result string diff --git a/tests/gethistory_test.go b/tests/gethistory_test.go index c1230903ba6..53dd75378aa 100644 --- a/tests/gethistory_test.go +++ b/tests/gethistory_test.go @@ -115,7 +115,7 @@ func (s *GetHistoryFunctionalSuite) TestGetWorkflowExecutionHistory_All() { // Start workflow execution request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: workflowID, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -171,7 +171,7 @@ func (s *GetHistoryFunctionalSuite) TestGetWorkflowExecutionHistory_All() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -204,7 +204,7 @@ func (s *GetHistoryFunctionalSuite) TestGetWorkflowExecutionHistory_All() { // here do a long pull (which return immediately with at least the WorkflowExecutionStarted) start := time.Now().UTC() - events, token = getHistory(s.Namespace(), workflowID, token, true) + events, token = getHistory(s.Namespace().String(), workflowID, token, true) allEvents = append(allEvents, events...) s.True(time.Now().UTC().Before(start.Add(time.Second * 5))) s.NotEmpty(events) @@ -217,7 +217,7 @@ func (s *GetHistoryFunctionalSuite) TestGetWorkflowExecutionHistory_All() { s.Logger.Info("PollAndProcessWorkflowTask", tag.Error(errWorkflowTask1)) }) start = time.Now().UTC() - events, token = getHistory(s.Namespace(), workflowID, token, true) + events, token = getHistory(s.Namespace().String(), workflowID, token, true) allEvents = append(allEvents, events...) s.True(time.Now().UTC().After(start.Add(time.Second * 5))) s.NotEmpty(events) @@ -233,7 +233,7 @@ func (s *GetHistoryFunctionalSuite) TestGetWorkflowExecutionHistory_All() { s.Logger.Info("PollAndProcessWorkflowTask", tag.Error(errWorkflowTask2)) }) for token != nil { - events, token = getHistory(s.Namespace(), workflowID, token, true) + events, token = getHistory(s.Namespace().String(), workflowID, token, true) allEvents = append(allEvents, events...) } s.EqualHistoryEvents(` @@ -253,7 +253,7 @@ func (s *GetHistoryFunctionalSuite) TestGetWorkflowExecutionHistory_All() { allEvents = nil token = nil for { - events, token = getHistory(s.Namespace(), workflowID, token, false) + events, token = getHistory(s.Namespace().String(), workflowID, token, false) allEvents = append(allEvents, events...) if token == nil { break @@ -288,7 +288,7 @@ func (s *GetHistoryFunctionalSuite) TestGetWorkflowExecutionHistory_Close() { // Start workflow execution request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: workflowID, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -344,7 +344,7 @@ func (s *GetHistoryFunctionalSuite) TestGetWorkflowExecutionHistory_Close() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -378,7 +378,7 @@ func (s *GetHistoryFunctionalSuite) TestGetWorkflowExecutionHistory_Close() { // here do a long pull (which return immediately with at least the WorkflowExecutionStarted) start := time.Now().UTC() - events, token = getHistory(s.Namespace(), workflowID, token, true) + events, token = getHistory(s.Namespace().String(), workflowID, token, true) s.True(time.Now().UTC().After(start.Add(time.Second * 10))) // since we are only interested in close event s.Empty(events) @@ -391,7 +391,7 @@ func (s *GetHistoryFunctionalSuite) TestGetWorkflowExecutionHistory_Close() { s.Logger.Info("PollAndProcessWorkflowTask", tag.Error(errWorkflowTask1)) }) start = time.Now().UTC() - events, token = getHistory(s.Namespace(), workflowID, token, true) + events, token = getHistory(s.Namespace().String(), workflowID, token, true) s.True(time.Now().UTC().After(start.Add(time.Second * 10))) // since we are only interested in close event s.Empty(events) @@ -407,7 +407,7 @@ func (s *GetHistoryFunctionalSuite) TestGetWorkflowExecutionHistory_Close() { s.Logger.Info("PollAndProcessWorkflowTask", tag.Error(errWorkflowTask2)) }) for token != nil { - events, token = getHistory(s.Namespace(), workflowID, token, true) + events, token = getHistory(s.Namespace().String(), workflowID, token, true) // since we are only interested in close event if token == nil { @@ -421,7 +421,7 @@ func (s *GetHistoryFunctionalSuite) TestGetWorkflowExecutionHistory_Close() { // test non long poll for only closed events token = nil for { - events, token = getHistory(s.Namespace(), workflowID, token, false) + events, token = getHistory(s.Namespace().String(), workflowID, token, false) if token == nil { break } @@ -444,7 +444,7 @@ func (s *RawHistorySuite) TestGetWorkflowExecutionHistory_GetRawHistoryData() { // Start workflow execution request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: workflowID, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -504,7 +504,7 @@ func (s *RawHistorySuite) TestGetWorkflowExecutionHistory_GetRawHistoryData() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -566,7 +566,7 @@ func (s *RawHistorySuite) TestGetWorkflowExecutionHistory_GetRawHistoryData() { // here do a long pull (which return immediately with at least the WorkflowExecutionStarted) start := time.Now().UTC() - blobs, token = getHistoryWithLongPoll(s.Namespace(), workflowID, token, true) + blobs, token = getHistoryWithLongPoll(s.Namespace().String(), workflowID, token, true) events = convertBlob(blobs) allEvents = append(allEvents, events...) s.True(time.Now().UTC().Before(start.Add(time.Second * 5))) @@ -580,7 +580,7 @@ func (s *RawHistorySuite) TestGetWorkflowExecutionHistory_GetRawHistoryData() { s.Logger.Info("PollAndProcessWorkflowTask", tag.Error(errWorkflowTask1)) }) start = time.Now().UTC() - blobs, token = getHistoryWithLongPoll(s.Namespace(), workflowID, token, true) + blobs, token = getHistoryWithLongPoll(s.Namespace().String(), workflowID, token, true) events = convertBlob(blobs) allEvents = append(allEvents, events...) s.True(time.Now().UTC().After(start.Add(time.Second * 5))) @@ -597,7 +597,7 @@ func (s *RawHistorySuite) TestGetWorkflowExecutionHistory_GetRawHistoryData() { s.Logger.Info("PollAndProcessWorkflowTask", tag.Error(errWorkflowTask2)) }) for token != nil { - blobs, token = getHistoryWithLongPoll(s.Namespace(), workflowID, token, true) + blobs, token = getHistoryWithLongPoll(s.Namespace().String(), workflowID, token, true) events = convertBlob(blobs) allEvents = append(allEvents, events...) } @@ -619,7 +619,7 @@ func (s *RawHistorySuite) TestGetWorkflowExecutionHistory_GetRawHistoryData() { allEvents = nil token = nil for { - blobs, token = getHistory(s.Namespace(), workflowID, token) + blobs, token = getHistory(s.Namespace().String(), workflowID, token) events = convertBlob(blobs) allEvents = append(allEvents, events...) if token == nil { @@ -692,18 +692,18 @@ func (s *RawHistoryClientSuite) TestGetHistoryReverse() { wfeResponse, err := s.SdkClient().DescribeWorkflowExecution(ctx, workflowRun.GetID(), workflowRun.GetRunID()) s.Nil(err) - eventDefaultOrder := s.GetHistory(s.Namespace(), wfeResponse.WorkflowExecutionInfo.Execution) + eventDefaultOrder := s.GetHistory(s.Namespace().String(), wfeResponse.WorkflowExecutionInfo.Execution) eventDefaultOrder = reverseSlice(eventDefaultOrder) - events := s.getHistoryReverse(s.Namespace(), wfeResponse.WorkflowExecutionInfo.Execution, 100) + events := s.getHistoryReverse(s.Namespace().String(), wfeResponse.WorkflowExecutionInfo.Execution, 100) s.Equal(len(eventDefaultOrder), len(events)) s.Equal(eventDefaultOrder, events) - events = s.getHistoryReverse(s.Namespace(), wfeResponse.WorkflowExecutionInfo.Execution, 3) + events = s.getHistoryReverse(s.Namespace().String(), wfeResponse.WorkflowExecutionInfo.Execution, 3) s.Equal(len(eventDefaultOrder), len(events)) s.Equal(eventDefaultOrder, events) - events = s.getHistoryReverse(s.Namespace(), wfeResponse.WorkflowExecutionInfo.Execution, 1) + events = s.getHistoryReverse(s.Namespace().String(), wfeResponse.WorkflowExecutionInfo.Execution, 1) s.Equal(len(eventDefaultOrder), len(events)) s.Equal(eventDefaultOrder, events) } @@ -770,7 +770,7 @@ func (s *RawHistoryClientSuite) TestGetHistoryReverse_MultipleBranches() { s.NoError(err) rweResponse, err := s.SdkClient().ResetWorkflowExecution(ctx, &workflowservice.ResetWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: wfeResponse.WorkflowExecutionInfo.Execution, Reason: "TestGetHistoryReverseBranch", WorkflowTaskFinishEventId: 10, @@ -786,18 +786,18 @@ func (s *RawHistoryClientSuite) TestGetHistoryReverse_MultipleBranches() { resetWfeResponse, err := s.SdkClient().DescribeWorkflowExecution(ctx, resetWorkflowRun.GetID(), resetWorkflowRun.GetRunID()) s.NoError(err) - eventsDefaultOrder := s.GetHistory(s.Namespace(), resetWfeResponse.WorkflowExecutionInfo.Execution) + eventsDefaultOrder := s.GetHistory(s.Namespace().String(), resetWfeResponse.WorkflowExecutionInfo.Execution) eventsDefaultOrder = reverseSlice(eventsDefaultOrder) - events := s.getHistoryReverse(s.Namespace(), resetWfeResponse.WorkflowExecutionInfo.Execution, 100) + events := s.getHistoryReverse(s.Namespace().String(), resetWfeResponse.WorkflowExecutionInfo.Execution, 100) s.Equal(len(eventsDefaultOrder), len(events)) s.Equal(eventsDefaultOrder, events) - events = s.getHistoryReverse(s.Namespace(), resetWfeResponse.WorkflowExecutionInfo.Execution, 3) + events = s.getHistoryReverse(s.Namespace().String(), resetWfeResponse.WorkflowExecutionInfo.Execution, 3) s.Equal(len(eventsDefaultOrder), len(events)) s.Equal(eventsDefaultOrder, events) - events = s.getHistoryReverse(s.Namespace(), resetWfeResponse.WorkflowExecutionInfo.Execution, 1) + events = s.getHistoryReverse(s.Namespace().String(), resetWfeResponse.WorkflowExecutionInfo.Execution, 1) s.Equal(len(eventsDefaultOrder), len(events)) s.Equal(eventsDefaultOrder, events) } diff --git a/tests/http_api_test.go b/tests/http_api_test.go index d22574b0355..7326bb45fd9 100644 --- a/tests/http_api_test.go +++ b/tests/http_api_test.go @@ -113,7 +113,7 @@ func (s *HttpApiTestSuite) runHTTPAPIBasicsTest( // Start workflowID := testcore.RandomizeStr("wf") - _, respBody := s.httpPost(http.StatusOK, "/namespaces/"+s.Namespace()+"/workflows/"+workflowID, contentType, startWFRequestBody()) + _, respBody := s.httpPost(http.StatusOK, "/namespaces/"+s.Namespace().String()+"/workflows/"+workflowID, contentType, startWFRequestBody()) var startResp struct { RunID string `json:"runId"` } @@ -126,7 +126,7 @@ func (s *HttpApiTestSuite) runHTTPAPIBasicsTest( for _, metric := range capture.Snapshot()[metrics.HTTPServiceRequests.Name()] { found = metric.Tags[metrics.OperationTagName] == "/temporal.api.workflowservice.v1.WorkflowService/StartWorkflowExecution" && - metric.Tags["namespace"] == s.Namespace() && + metric.Tags["namespace"] == s.Namespace().String() && metric.Value == int64(1) if found { break @@ -135,7 +135,7 @@ func (s *HttpApiTestSuite) runHTTPAPIBasicsTest( s.Require().True(found) // Confirm already exists error with details and proper code - _, respBody = s.httpPost(http.StatusConflict, "/namespaces/"+s.Namespace()+"/workflows/"+workflowID, contentType, startWFRequestBody()) + _, respBody = s.httpPost(http.StatusConflict, "/namespaces/"+s.Namespace().String()+"/workflows/"+workflowID, contentType, startWFRequestBody()) var errResp struct { Message string `json:"message"` Details []struct { @@ -149,7 +149,7 @@ func (s *HttpApiTestSuite) runHTTPAPIBasicsTest( // Query _, respBody = s.httpPost( http.StatusOK, - "/namespaces/"+s.Namespace()+"/workflows/"+workflowID+"/query/some-query", + "/namespaces/"+s.Namespace().String()+"/workflows/"+workflowID+"/query/some-query", contentType, queryBody(), ) @@ -158,7 +158,7 @@ func (s *HttpApiTestSuite) runHTTPAPIBasicsTest( // Signal which also completes the workflow s.httpPost( http.StatusOK, - "/namespaces/"+s.Namespace()+"/workflows/"+workflowID+"/signal/some-signal", + "/namespaces/"+s.Namespace().String()+"/workflows/"+workflowID+"/signal/some-signal", contentType, signalBody(), ) @@ -167,7 +167,7 @@ func (s *HttpApiTestSuite) runHTTPAPIBasicsTest( _, respBody = s.httpGet( http.StatusOK, // Our version of gRPC gateway only supports integer enums in queries :-( - "/namespaces/"+s.Namespace()+"/workflows/"+workflowID+"/history?historyEventFilterType=2", + "/namespaces/"+s.Namespace().String()+"/workflows/"+workflowID+"/history?historyEventFilterType=2", contentType, ) verifyHistory(s, respBody) @@ -358,7 +358,7 @@ func (s *HttpApiTestSuite) TestHTTPAPIHeaders() { }) // Make a simple list call that we don't care about the result - req, err := http.NewRequest("GET", "/namespaces/"+s.Namespace()+"/workflows", nil) + req, err := http.NewRequest("GET", "/namespaces/"+s.Namespace().String()+"/workflows", nil) s.Require().NoError(err) req.Header.Set("Authorization", "my-auth-token") req.Header.Set("X-Forwarded-For", "1.2.3.4:5678") @@ -436,7 +436,7 @@ func (s *HttpApiTestSuite) httpRequest(expectedStatus int, req *http.Request) (* func (s *HttpApiTestSuite) TestHTTPAPI_OperatorService_ListSearchAttributes() { _, respBody := s.httpGet( http.StatusOK, - "/cluster/namespaces/"+s.Namespace()+"/search-attributes", + "/cluster/namespaces/"+s.Namespace().String()+"/search-attributes", "application/json", ) s.T().Log(string(respBody)) diff --git a/tests/links_test.go b/tests/links_test.go index 57da6dc48ae..2c0ec36cfe8 100644 --- a/tests/links_test.go +++ b/tests/links_test.go @@ -72,7 +72,7 @@ func (s *LinksSuite) TestTerminateWorkflow_LinksAttachedToEvent() { // TODO(bergundy): Use SdkClient if and when it exposes links on TerminateWorkflow. _, err = s.FrontendClient().TerminateWorkflowExecution(ctx, &workflowservice.TerminateWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: &commonpb.WorkflowExecution{ WorkflowId: run.GetID(), }, @@ -101,7 +101,7 @@ func (s *LinksSuite) TestRequestCancelWorkflow_LinksAttachedToEvent() { // TODO(bergundy): Use SdkClient if and when it exposes links on CancelWorkflow. _, err = s.FrontendClient().RequestCancelWorkflowExecution(ctx, &workflowservice.RequestCancelWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: &commonpb.WorkflowExecution{ WorkflowId: run.GetID(), }, @@ -138,7 +138,7 @@ func (s *LinksSuite) TestSignalWorkflowExecution_LinksAttachedToEvent() { // TODO(bergundy): Use SdkClient if and when it exposes links on SignalWorkflow. _, err = s.FrontendClient().SignalWorkflowExecution(ctx, &workflowservice.SignalWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: &commonpb.WorkflowExecution{ WorkflowId: run.GetID(), }, @@ -171,7 +171,7 @@ func (s *LinksSuite) TestSignalWithStartWorkflowExecution_LinksAttachedToRelevan // TODO(bergundy): Use SdkClient if and when it exposes links on SignalWithStartWorkflow. request := &workflowservice.SignalWithStartWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: workflowID, WorkflowType: &commonpb.WorkflowType{ Name: "dont-care", diff --git a/tests/max_buffered_event_test.go b/tests/max_buffered_event_test.go index 386e928b1af..aacdc253011 100644 --- a/tests/max_buffered_event_test.go +++ b/tests/max_buffered_event_test.go @@ -125,7 +125,7 @@ func (s *MaxBufferedEventSuite) TestMaxBufferedEventsLimit() { s.NoError(err) s.Equal(101, sigCount) - historyEvents := s.GetHistory(s.Namespace(), &commonpb.WorkflowExecution{WorkflowId: wf1.GetID()}) + historyEvents := s.GetHistory(s.Namespace().String(), &commonpb.WorkflowExecution{WorkflowId: wf1.GetID()}) // Not using historyrequire here because history is not deterministic. var failedCause enumspb.WorkflowTaskFailedCause var failedCount int @@ -217,7 +217,7 @@ func (s *MaxBufferedEventSuite) TestBufferedEventsMutableStateSizeLimit() { s.NoError(err) s.Equal(4, sigCount) - historyEvents := s.GetHistory(s.Namespace(), &commonpb.WorkflowExecution{WorkflowId: wf1.GetID()}) + historyEvents := s.GetHistory(s.Namespace().String(), &commonpb.WorkflowExecution{WorkflowId: wf1.GetID()}) // Not using historyrequire here because history is not deterministic. var failedCause enumspb.WorkflowTaskFailedCause var failedCount int diff --git a/tests/namespace_interceptor_test.go b/tests/namespace_interceptor_test.go index 08273bfae48..0afb3e73ce2 100644 --- a/tests/namespace_interceptor_test.go +++ b/tests/namespace_interceptor_test.go @@ -53,7 +53,7 @@ func TestNamespaceInterceptorTestSuite(t *testing.T) { func (s *NamespaceInterceptorTestSuite) TestServerRejectsInvalidRequests() { sut := newSystemUnderTestConnector(s) - customersNamespace := namespace.Name(s.Namespace()) + customersNamespace := s.Namespace() err := sut.startWorkflowExecution(customersNamespace) s.NoError(err) diff --git a/tests/nexus_api_test.go b/tests/nexus_api_test.go index e9e1948ee60..95050aa6e22 100644 --- a/tests/nexus_api_test.go +++ b/tests/nexus_api_test.go @@ -279,13 +279,13 @@ func (s *NexusApiTestSuite) TestNexusStartOperation_Outcomes() { snap := capture.Snapshot() require.Equal(t, 1, len(snap["nexus_requests"])) - require.Subset(t, snap["nexus_requests"][0].Tags, map[string]string{"namespace": s.Namespace(), "method": "StartNexusOperation", "outcome": tc.outcome}) + require.Subset(t, snap["nexus_requests"][0].Tags, map[string]string{"namespace": s.Namespace().String(), "method": "StartNexusOperation", "outcome": tc.outcome}) require.Contains(t, snap["nexus_requests"][0].Tags, "nexus_endpoint") require.Equal(t, int64(1), snap["nexus_requests"][0].Value) require.Equal(t, metrics.MetricUnit(""), snap["nexus_requests"][0].Unit) require.Equal(t, 1, len(snap["nexus_latency"])) - require.Subset(t, snap["nexus_latency"][0].Tags, map[string]string{"namespace": s.Namespace(), "method": "StartNexusOperation", "outcome": tc.outcome}) + require.Subset(t, snap["nexus_latency"][0].Tags, map[string]string{"namespace": s.Namespace().String(), "method": "StartNexusOperation", "outcome": tc.outcome}) require.Contains(t, snap["nexus_latency"][0].Tags, "nexus_endpoint") // Ensure that StartOperation request is tracked as part of normal service telemetry metrics @@ -302,7 +302,7 @@ func (s *NexusApiTestSuite) TestNexusStartOperation_Outcomes() { for _, tc := range testCases { s.T().Run(tc.outcome, func(t *testing.T) { t.Run("ByNamespaceAndTaskQueue", func(t *testing.T) { - testFn(t, tc, getDispatchByNsAndTqURL(s.HttpAPIAddress(), s.Namespace(), tc.endpoint.Spec.Target.GetWorker().TaskQueue)) + testFn(t, tc, getDispatchByNsAndTqURL(s.HttpAPIAddress(), s.Namespace().String(), tc.endpoint.Spec.Target.GetWorker().TaskQueue)) }) t.Run("ByEndpoint", func(t *testing.T) { testFn(t, tc, getDispatchByEndpointURL(s.HttpAPIAddress(), tc.endpoint.Id)) @@ -443,7 +443,7 @@ func (s *NexusApiTestSuite) TestNexusStartOperation_Forbidden() { snap := capture.Snapshot() require.Equal(t, 1, len(snap["nexus_requests"])) - require.Subset(t, snap["nexus_requests"][0].Tags, map[string]string{"namespace": s.Namespace(), "method": "StartNexusOperation", "outcome": "unauthorized"}) + require.Subset(t, snap["nexus_requests"][0].Tags, map[string]string{"namespace": s.Namespace().String(), "method": "StartNexusOperation", "outcome": "unauthorized"}) require.Equal(t, int64(1), snap["nexus_requests"][0].Value) } @@ -453,7 +453,7 @@ func (s *NexusApiTestSuite) TestNexusStartOperation_Forbidden() { defer s.GetTestCluster().Host().SetOnAuthorize(nil) t.Run("ByNamespaceAndTaskQueue", func(t *testing.T) { - testFn(t, tc, getDispatchByNsAndTqURL(s.HttpAPIAddress(), s.Namespace(), taskQueue)) + testFn(t, tc, getDispatchByNsAndTqURL(s.HttpAPIAddress(), s.Namespace().String(), taskQueue)) }) t.Run("ByEndpoint", func(t *testing.T) { testFn(t, tc, getDispatchByEndpointURL(s.HttpAPIAddress(), testEndpoint.Id)) @@ -563,7 +563,7 @@ func (s *NexusApiTestSuite) TestNexusStartOperation_Claims() { for _, tc := range testCases { s.T().Run(tc.name, func(t *testing.T) { t.Run("ByNamespaceAndTaskQueue", func(t *testing.T) { - testFn(t, tc, getDispatchByNsAndTqURL(s.HttpAPIAddress(), s.Namespace(), taskQueue)) + testFn(t, tc, getDispatchByNsAndTqURL(s.HttpAPIAddress(), s.Namespace().String(), taskQueue)) }) t.Run("ByEndpoint", func(t *testing.T) { testFn(t, tc, getDispatchByEndpointURL(s.HttpAPIAddress(), testEndpoint.Id)) @@ -609,7 +609,7 @@ func (s *NexusApiTestSuite) TestNexusStartOperation_PayloadSizeLimit() { } s.T().Run("ByNamespaceAndTaskQueue", func(t *testing.T) { - testFn(t, getDispatchByNsAndTqURL(s.HttpAPIAddress(), s.Namespace(), taskQueue)) + testFn(t, getDispatchByNsAndTqURL(s.HttpAPIAddress(), s.Namespace().String(), taskQueue)) }) s.T().Run("ByEndpoint", func(t *testing.T) { testFn(t, getDispatchByEndpointURL(s.HttpAPIAddress(), testEndpoint.Id)) @@ -722,13 +722,13 @@ func (s *NexusApiTestSuite) TestNexusCancelOperation_Outcomes() { snap := capture.Snapshot() require.Equal(t, 1, len(snap["nexus_requests"])) - require.Subset(t, snap["nexus_requests"][0].Tags, map[string]string{"namespace": s.Namespace(), "method": "CancelNexusOperation", "outcome": tc.outcome}) + require.Subset(t, snap["nexus_requests"][0].Tags, map[string]string{"namespace": s.Namespace().String(), "method": "CancelNexusOperation", "outcome": tc.outcome}) require.Contains(t, snap["nexus_requests"][0].Tags, "nexus_endpoint") require.Equal(t, int64(1), snap["nexus_requests"][0].Value) require.Equal(t, metrics.MetricUnit(""), snap["nexus_requests"][0].Unit) require.Equal(t, 1, len(snap["nexus_latency"])) - require.Subset(t, snap["nexus_latency"][0].Tags, map[string]string{"namespace": s.Namespace(), "method": "CancelNexusOperation", "outcome": tc.outcome}) + require.Subset(t, snap["nexus_latency"][0].Tags, map[string]string{"namespace": s.Namespace().String(), "method": "CancelNexusOperation", "outcome": tc.outcome}) require.Contains(t, snap["nexus_latency"][0].Tags, "nexus_endpoint") // Ensure that CancelOperation request is tracked as part of normal service telemetry metrics @@ -745,7 +745,7 @@ func (s *NexusApiTestSuite) TestNexusCancelOperation_Outcomes() { for _, tc := range testCases { s.T().Run(tc.outcome, func(t *testing.T) { t.Run("ByNamespaceAndTaskQueue", func(t *testing.T) { - testFn(t, tc, getDispatchByNsAndTqURL(s.HttpAPIAddress(), s.Namespace(), tc.endpoint.Spec.Target.GetWorker().TaskQueue)) + testFn(t, tc, getDispatchByNsAndTqURL(s.HttpAPIAddress(), s.Namespace().String(), tc.endpoint.Spec.Target.GetWorker().TaskQueue)) }) t.Run("ByEndpoint", func(t *testing.T) { testFn(t, tc, getDispatchByEndpointURL(s.HttpAPIAddress(), tc.endpoint.Id)) @@ -769,7 +769,7 @@ func (s *NexusApiTestSuite) TestNexusStartOperation_WithNamespaceAndTaskQueue_Su }) s.NoError(err) - u := getDispatchByNsAndTqURL(s.HttpAPIAddress(), s.Namespace(), taskQueue) + u := getDispatchByNsAndTqURL(s.HttpAPIAddress(), s.Namespace().String(), taskQueue) client, err := nexus.NewHTTPClient(nexus.HTTPClientOptions{BaseURL: u, Service: "test-service"}) s.NoError(err) // Versioned poller gets task @@ -799,7 +799,7 @@ func (s *NexusApiTestSuite) TestNexus_RespondNexusTaskMethods_VerifiesTaskTokenM ctx := testcore.NewContext() tt := tokenspb.NexusTask{ - NamespaceId: s.GetNamespaceID(s.Namespace()), + NamespaceId: s.NamespaceID().String(), TaskQueue: "test", TaskId: uuid.NewString(), } @@ -807,7 +807,7 @@ func (s *NexusApiTestSuite) TestNexus_RespondNexusTaskMethods_VerifiesTaskTokenM s.NoError(err) _, err = s.GetTestCluster().FrontendClient().RespondNexusTaskCompleted(ctx, &workflowservice.RespondNexusTaskCompletedRequest{ - Namespace: s.ForeignNamespace(), + Namespace: s.ForeignNamespace().String(), Identity: uuid.NewString(), TaskToken: ttBytes, Response: &nexuspb.Response{}, @@ -815,7 +815,7 @@ func (s *NexusApiTestSuite) TestNexus_RespondNexusTaskMethods_VerifiesTaskTokenM s.ErrorContains(err, "Operation requested with a token from a different namespace.") _, err = s.GetTestCluster().FrontendClient().RespondNexusTaskFailed(ctx, &workflowservice.RespondNexusTaskFailedRequest{ - Namespace: s.ForeignNamespace(), + Namespace: s.ForeignNamespace().String(), Identity: uuid.NewString(), TaskToken: ttBytes, Error: &nexuspb.HandlerError{}, @@ -827,7 +827,7 @@ func (s *NexusApiTestSuite) TestNexus_RespondNexusTaskMethods_ValidateFailureDet ctx := testcore.NewContext() tt := tokenspb.NexusTask{ - NamespaceId: s.GetNamespaceID(s.Namespace()), + NamespaceId: s.NamespaceID().String(), TaskQueue: "test", TaskId: uuid.NewString(), } @@ -835,7 +835,7 @@ func (s *NexusApiTestSuite) TestNexus_RespondNexusTaskMethods_ValidateFailureDet s.NoError(err) _, err = s.GetTestCluster().FrontendClient().RespondNexusTaskCompleted(ctx, &workflowservice.RespondNexusTaskCompletedRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Identity: uuid.NewString(), TaskToken: ttBytes, Response: &nexuspb.Response{ @@ -858,7 +858,7 @@ func (s *NexusApiTestSuite) TestNexus_RespondNexusTaskMethods_ValidateFailureDet s.Equal("failure details must be JSON serializable", invalidArgumentErr.Message) _, err = s.GetTestCluster().FrontendClient().RespondNexusTaskFailed(ctx, &workflowservice.RespondNexusTaskFailedRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Identity: uuid.NewString(), TaskToken: ttBytes, Error: &nexuspb.HandlerError{ @@ -897,7 +897,7 @@ func (s *NexusApiTestSuite) versionedNexusTaskPoller(ctx context.Context, taskQu } } res, err := s.GetTestCluster().FrontendClient().PollNexusTaskQueue(ctx, &workflowservice.PollNexusTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Identity: uuid.NewString(), TaskQueue: &taskqueuepb.TaskQueue{ Name: taskQueue, @@ -919,7 +919,7 @@ func (s *NexusApiTestSuite) versionedNexusTaskPoller(ctx context.Context, taskQu response, handlerError := handler(res) if handlerError != nil { _, err = s.GetTestCluster().FrontendClient().RespondNexusTaskFailed(ctx, &workflowservice.RespondNexusTaskFailedRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Identity: uuid.NewString(), TaskToken: res.TaskToken, Error: handlerError, @@ -930,7 +930,7 @@ func (s *NexusApiTestSuite) versionedNexusTaskPoller(ctx context.Context, taskQu } } else if response != nil { _, err = s.GetTestCluster().FrontendClient().RespondNexusTaskCompleted(ctx, &workflowservice.RespondNexusTaskCompletedRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Identity: uuid.NewString(), TaskToken: res.TaskToken, Response: response, @@ -975,7 +975,7 @@ func (s *NexusApiTestSuite) createNexusEndpoint(name string, taskQueue string) * Target: &nexuspb.EndpointTarget{ Variant: &nexuspb.EndpointTarget_Worker_{ Worker: &nexuspb.EndpointTarget_Worker{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, }, }, diff --git a/tests/nexus_endpoint_test.go b/tests/nexus_endpoint_test.go index 20388c0bd49..739dc572cb1 100644 --- a/tests/nexus_endpoint_test.go +++ b/tests/nexus_endpoint_test.go @@ -174,7 +174,7 @@ func (s *MatchingSuite) TestCreate() { s.NotNil(entry.Endpoint.CreatedTime) s.NotEmpty(entry.Id) s.Equal(entry.Endpoint.Spec.Name, endpointName) - s.Equal(entry.Endpoint.Spec.Target.GetWorker().NamespaceId, s.GetNamespaceID(s.Namespace())) + s.Equal(entry.Endpoint.Spec.Target.GetWorker().NamespaceId, s.NamespaceID().String()) _, err := s.GetTestCluster().MatchingClient().CreateNexusEndpoint(testcore.NewContext(), &matchingservice.CreateNexusEndpointRequest{ Spec: &persistencespb.NexusEndpointSpec{ @@ -182,7 +182,7 @@ func (s *MatchingSuite) TestCreate() { Target: &persistencespb.NexusEndpointTarget{ Variant: &persistencespb.NexusEndpointTarget_Worker_{ Worker: &persistencespb.NexusEndpointTarget_Worker{ - NamespaceId: s.GetNamespaceID(s.Namespace()), + NamespaceId: s.NamespaceID().String(), TaskQueue: "dont-care", }, }, @@ -213,7 +213,7 @@ func (s *MatchingSuite) TestUpdate() { Target: &persistencespb.NexusEndpointTarget{ Variant: &persistencespb.NexusEndpointTarget_Worker_{ Worker: &persistencespb.NexusEndpointTarget_Worker{ - NamespaceId: s.GetNamespaceID(s.Namespace()), + NamespaceId: s.NamespaceID().String(), TaskQueue: s.defaultTaskQueue().Name, }, }, @@ -238,7 +238,7 @@ func (s *MatchingSuite) TestUpdate() { Target: &persistencespb.NexusEndpointTarget{ Variant: &persistencespb.NexusEndpointTarget_Worker_{ Worker: &persistencespb.NexusEndpointTarget_Worker{ - NamespaceId: s.GetNamespaceID(s.Namespace()), + NamespaceId: s.NamespaceID().String(), TaskQueue: s.defaultTaskQueue().Name, }, }, @@ -260,7 +260,7 @@ func (s *MatchingSuite) TestUpdate() { Target: &persistencespb.NexusEndpointTarget{ Variant: &persistencespb.NexusEndpointTarget_Worker_{ Worker: &persistencespb.NexusEndpointTarget_Worker{ - NamespaceId: s.GetNamespaceID(s.Namespace()), + NamespaceId: s.NamespaceID().String(), TaskQueue: s.defaultTaskQueue().Name, }, }, @@ -484,7 +484,7 @@ func (s *OperatorSuite) TestCreate() { Target: &nexuspb.EndpointTarget{ Variant: &nexuspb.EndpointTarget_Worker_{ Worker: &nexuspb.EndpointTarget_Worker{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: s.defaultTaskQueue().Name, }, }, @@ -499,7 +499,7 @@ func (s *OperatorSuite) TestCreate() { s.NotNil(resp.Endpoint.CreatedTime) s.NotEmpty(resp.Endpoint.Id) s.Equal(resp.Endpoint.Spec.Name, endpointName) - s.Equal(resp.Endpoint.Spec.Target.GetWorker().Namespace, s.Namespace()) + s.Equal(resp.Endpoint.Spec.Target.GetWorker().Namespace, s.Namespace().String()) s.Equal("/"+commonnexus.RouteDispatchNexusTaskByEndpoint.Path(resp.Endpoint.Id), resp.Endpoint.UrlPrefix) }, }, @@ -511,7 +511,7 @@ func (s *OperatorSuite) TestCreate() { Target: &nexuspb.EndpointTarget{ Variant: &nexuspb.EndpointTarget_Worker_{ Worker: &nexuspb.EndpointTarget_Worker{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: s.defaultTaskQueue().Name, }, }, @@ -530,7 +530,7 @@ func (s *OperatorSuite) TestCreate() { Target: &nexuspb.EndpointTarget{ Variant: &nexuspb.EndpointTarget_Worker_{ Worker: &nexuspb.EndpointTarget_Worker{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: s.defaultTaskQueue().Name, }, }, @@ -550,7 +550,7 @@ func (s *OperatorSuite) TestCreate() { Target: &nexuspb.EndpointTarget{ Variant: &nexuspb.EndpointTarget_Worker_{ Worker: &nexuspb.EndpointTarget_Worker{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: s.defaultTaskQueue().Name, }, }, @@ -570,7 +570,7 @@ func (s *OperatorSuite) TestCreate() { Target: &nexuspb.EndpointTarget{ Variant: &nexuspb.EndpointTarget_Worker_{ Worker: &nexuspb.EndpointTarget_Worker{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: s.defaultTaskQueue().Name, }, }, @@ -629,7 +629,7 @@ func (s *OperatorSuite) TestCreate() { Target: &nexuspb.EndpointTarget{ Variant: &nexuspb.EndpointTarget_Worker_{ Worker: &nexuspb.EndpointTarget_Worker{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), }, }, }, @@ -648,7 +648,7 @@ func (s *OperatorSuite) TestCreate() { Target: &nexuspb.EndpointTarget{ Variant: &nexuspb.EndpointTarget_Worker_{ Worker: &nexuspb.EndpointTarget_Worker{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: string(make([]byte, 1005)), }, }, @@ -742,7 +742,7 @@ func (s *OperatorSuite) TestCreate() { Target: &nexuspb.EndpointTarget{ Variant: &nexuspb.EndpointTarget_Worker_{ Worker: &nexuspb.EndpointTarget_Worker{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: s.defaultTaskQueue().Name, }, }, @@ -787,7 +787,7 @@ func (s *OperatorSuite) TestUpdate() { Target: &nexuspb.EndpointTarget{ Variant: &nexuspb.EndpointTarget_Worker_{ Worker: &nexuspb.EndpointTarget_Worker{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: s.defaultTaskQueue().Name, }, }, @@ -812,7 +812,7 @@ func (s *OperatorSuite) TestUpdate() { Target: &nexuspb.EndpointTarget{ Variant: &nexuspb.EndpointTarget_Worker_{ Worker: &nexuspb.EndpointTarget_Worker{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: s.defaultTaskQueue().Name, }, }, @@ -834,7 +834,7 @@ func (s *OperatorSuite) TestUpdate() { Target: &nexuspb.EndpointTarget{ Variant: &nexuspb.EndpointTarget_Worker_{ Worker: &nexuspb.EndpointTarget_Worker{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: s.defaultTaskQueue().Name, }, }, @@ -1062,7 +1062,7 @@ func (s *NexusEndpointFunctionalSuite) createNexusEndpoint(name string) *persist Target: &persistencespb.NexusEndpointTarget{ Variant: &persistencespb.NexusEndpointTarget_Worker_{ Worker: &persistencespb.NexusEndpointTarget_Worker{ - NamespaceId: s.GetNamespaceID(s.Namespace()), + NamespaceId: s.NamespaceID().String(), TaskQueue: s.defaultTaskQueue().Name, }, }, diff --git a/tests/nexus_test_base.go b/tests/nexus_test_base.go index 0c42746303b..ddd4f20d56a 100644 --- a/tests/nexus_test_base.go +++ b/tests/nexus_test_base.go @@ -62,7 +62,7 @@ func (s *NexusTestBaseSuite) versionedNexusTaskPoller(ctx context.Context, taskQ } } res, err := s.GetTestCluster().FrontendClient().PollNexusTaskQueue(ctx, &workflowservice.PollNexusTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Identity: uuid.NewString(), TaskQueue: &taskqueuepb.TaskQueue{ Name: taskQueue, @@ -84,7 +84,7 @@ func (s *NexusTestBaseSuite) versionedNexusTaskPoller(ctx context.Context, taskQ response, handlerError := handler(res) if handlerError != nil { _, err = s.GetTestCluster().FrontendClient().RespondNexusTaskFailed(ctx, &workflowservice.RespondNexusTaskFailedRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Identity: uuid.NewString(), TaskToken: res.TaskToken, Error: handlerError, @@ -96,7 +96,7 @@ func (s *NexusTestBaseSuite) versionedNexusTaskPoller(ctx context.Context, taskQ } } else if response != nil { _, err = s.GetTestCluster().FrontendClient().RespondNexusTaskCompleted(ctx, &workflowservice.RespondNexusTaskCompletedRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Identity: uuid.NewString(), TaskToken: res.TaskToken, Response: response, diff --git a/tests/nexus_workflow_test.go b/tests/nexus_workflow_test.go index 0202bd9b2aa..2d2a6027e07 100644 --- a/tests/nexus_workflow_test.go +++ b/tests/nexus_workflow_test.go @@ -116,7 +116,7 @@ func (s *NexusWorkflowTestSuite) TestNexusOperationCancelation() { s.EventuallyWithT(func(t *assert.CollectT) { pollResp, err := s.FrontendClient().PollWorkflowTaskQueue(ctx, &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{ Name: taskQueue, Kind: enumspb.TASK_QUEUE_KIND_NORMAL, @@ -149,7 +149,7 @@ func (s *NexusWorkflowTestSuite) TestNexusOperationCancelation() { // Poll and wait for the "started" event to be recorded. pollResp, err := s.FrontendClient().PollWorkflowTaskQueue(ctx, &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{ Name: taskQueue, Kind: enumspb.TASK_QUEUE_KIND_NORMAL, @@ -243,7 +243,7 @@ func (s *NexusWorkflowTestSuite) TestNexusOperationSyncCompletion() { s.EventuallyWithT(func(t *assert.CollectT) { pollResp, err := s.FrontendClient().PollWorkflowTaskQueue(ctx, &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{ Name: taskQueue, Kind: enumspb.TASK_QUEUE_KIND_NORMAL, @@ -275,7 +275,7 @@ func (s *NexusWorkflowTestSuite) TestNexusOperationSyncCompletion() { }, time.Second*20, time.Millisecond*200) pollResp, err := s.FrontendClient().PollWorkflowTaskQueue(ctx, &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{ Name: taskQueue, Kind: enumspb.TASK_QUEUE_KIND_NORMAL, @@ -348,7 +348,7 @@ func (s *NexusWorkflowTestSuite) TestNexusOperationSyncCompletion_LargePayload() s.EventuallyWithT(func(t *assert.CollectT) { pollResp, err := s.FrontendClient().PollWorkflowTaskQueue(ctx, &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{ Name: taskQueue, Kind: enumspb.TASK_QUEUE_KIND_NORMAL, @@ -380,7 +380,7 @@ func (s *NexusWorkflowTestSuite) TestNexusOperationSyncCompletion_LargePayload() }, time.Second*20, time.Millisecond*200) pollResp, err := s.FrontendClient().PollWorkflowTaskQueue(ctx, &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{ Name: taskQueue, Kind: enumspb.TASK_QUEUE_KIND_NORMAL, @@ -467,7 +467,7 @@ func (s *NexusWorkflowTestSuite) TestNexusOperationAsyncCompletion() { } s.NotNil(links[0].GetWorkflowEvent()) protorequire.ProtoEqual(s.T(), &commonpb.Link_WorkflowEvent{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: run.GetID(), RunId: run.GetRunID(), Reference: &commonpb.Link_WorkflowEvent_EventRef{ @@ -510,7 +510,7 @@ func (s *NexusWorkflowTestSuite) TestNexusOperationAsyncCompletion() { s.NoError(err) pollResp, err := s.FrontendClient().PollWorkflowTaskQueue(ctx, &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{ Name: taskQueue, Kind: enumspb.TASK_QUEUE_KIND_NORMAL, @@ -539,7 +539,7 @@ func (s *NexusWorkflowTestSuite) TestNexusOperationAsyncCompletion() { // Poll and verify that the "started" event was recorded. pollResp, err = s.FrontendClient().PollWorkflowTaskQueue(ctx, &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{ Name: taskQueue, Kind: enumspb.TASK_QUEUE_KIND_NORMAL, @@ -577,7 +577,7 @@ func (s *NexusWorkflowTestSuite) TestNexusOperationAsyncCompletion() { res, snap := s.sendNexusCompletionRequest(ctx, s.T(), publicCallbackUrl, largeCompletion, callbackToken) s.Equal(http.StatusBadRequest, res.StatusCode) s.Equal(1, len(snap["nexus_completion_requests"])) - s.Subset(snap["nexus_completion_requests"][0].Tags, map[string]string{"namespace": s.Namespace(), "outcome": "error_bad_request"}) + s.Subset(snap["nexus_completion_requests"][0].Tags, map[string]string{"namespace": s.Namespace().String(), "outcome": "error_bad_request"}) completion, err := nexus.NewOperationCompletionSuccessful(s.mustToPayload(nil), nexus.OperationCompletionSuccessfulOptions{ Serializer: commonnexus.PayloadSerializer, @@ -614,7 +614,7 @@ func (s *NexusWorkflowTestSuite) TestNexusOperationAsyncCompletion() { res, snap = s.sendNexusCompletionRequest(ctx, s.T(), publicCallbackUrl, completion, callbackToken) s.Equal(http.StatusNotFound, res.StatusCode) s.Equal(1, len(snap["nexus_completion_requests"])) - s.Subset(snap["nexus_completion_requests"][0].Tags, map[string]string{"namespace": s.Namespace(), "outcome": "error_not_found"}) + s.Subset(snap["nexus_completion_requests"][0].Tags, map[string]string{"namespace": s.Namespace().String(), "outcome": "error_not_found"}) // Request fails if the state machine reference is stale. staleToken := common.CloneProto(completionToken) @@ -625,7 +625,7 @@ func (s *NexusWorkflowTestSuite) TestNexusOperationAsyncCompletion() { res, snap = s.sendNexusCompletionRequest(ctx, s.T(), publicCallbackUrl, completion, callbackToken) s.Equal(http.StatusNotFound, res.StatusCode) s.Equal(1, len(snap["nexus_completion_requests"])) - s.Subset(snap["nexus_completion_requests"][0].Tags, map[string]string{"namespace": s.Namespace(), "outcome": "error_not_found"}) + s.Subset(snap["nexus_completion_requests"][0].Tags, map[string]string{"namespace": s.Namespace().String(), "outcome": "error_not_found"}) // Send a valid - successful completion request. completion, err = nexus.NewOperationCompletionSuccessful(s.mustToPayload("result"), nexus.OperationCompletionSuccessfulOptions{ @@ -639,7 +639,7 @@ func (s *NexusWorkflowTestSuite) TestNexusOperationAsyncCompletion() { res, snap = s.sendNexusCompletionRequest(ctx, s.T(), publicCallbackUrl, completion, callbackToken) s.Equal(http.StatusOK, res.StatusCode) s.Equal(1, len(snap["nexus_completion_requests"])) - s.Subset(snap["nexus_completion_requests"][0].Tags, map[string]string{"namespace": s.Namespace(), "outcome": "success"}) + s.Subset(snap["nexus_completion_requests"][0].Tags, map[string]string{"namespace": s.Namespace().String(), "outcome": "success"}) // Ensure that CompleteOperation request is tracked as part of normal service telemetry metrics idx := slices.IndexFunc(snap["service_requests"], func(m *metricstest.CapturedRecording) bool { opTag, ok := m.Tags["operation"] @@ -651,11 +651,11 @@ func (s *NexusWorkflowTestSuite) TestNexusOperationAsyncCompletion() { res, snap = s.sendNexusCompletionRequest(ctx, s.T(), publicCallbackUrl, completion, callbackToken) s.Equal(http.StatusNotFound, res.StatusCode) s.Equal(1, len(snap["nexus_completion_requests"])) - s.Subset(snap["nexus_completion_requests"][0].Tags, map[string]string{"namespace": s.Namespace(), "outcome": "error_not_found"}) + s.Subset(snap["nexus_completion_requests"][0].Tags, map[string]string{"namespace": s.Namespace().String(), "outcome": "error_not_found"}) // Poll again and verify the completion is recorded and triggers workflow progress. pollResp, err = s.FrontendClient().PollWorkflowTaskQueue(ctx, &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{ Name: taskQueue, Kind: enumspb.TASK_QUEUE_KIND_NORMAL, @@ -693,7 +693,7 @@ func (s *NexusWorkflowTestSuite) TestNexusOperationAsyncCompletion() { // Reset the workflow and check that the completion event has been reapplied. resp, err := s.FrontendClient().ResetWorkflowExecution(ctx, &workflowservice.ResetWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: pollResp.WorkflowExecution, Reason: "test", RequestId: uuid.NewString(), @@ -717,7 +717,7 @@ func (s *NexusWorkflowTestSuite) TestNexusOperationAsyncCompletion() { // Reset the workflow again to the same point with enumspb.RESET_REAPPLY_EXCLUDE_TYPE_NEXUS option // and verify that the completion event has been excluded. resp, err = s.FrontendClient().ResetWorkflowExecution(ctx, &workflowservice.ResetWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: pollResp.WorkflowExecution, Reason: "test", RequestId: uuid.NewString(), @@ -751,7 +751,7 @@ func (s *NexusWorkflowTestSuite) TestNexusOperationAsyncCompletionBeforeStart() Target: &nexuspb.EndpointTarget{ Variant: &nexuspb.EndpointTarget_Worker_{ Worker: &nexuspb.EndpointTarget_Worker{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, }, }, @@ -770,7 +770,7 @@ func (s *NexusWorkflowTestSuite) TestNexusOperationAsyncCompletionBeforeStart() completionWFTaskQueue := testcore.RandomizeStr(s.T().Name()) completionWFStartReq := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.NewString(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: completionWFID, WorkflowType: &commonpb.WorkflowType{Name: completionWFType}, TaskQueue: &taskqueuepb.TaskQueue{Name: completionWFTaskQueue, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, @@ -779,7 +779,7 @@ func (s *NexusWorkflowTestSuite) TestNexusOperationAsyncCompletionBeforeStart() Identity: "test", } startLink := &commonpb.Link_WorkflowEvent{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: completionWFID, Reference: &commonpb.Link_WorkflowEvent_EventRef{ EventRef: &commonpb.Link_WorkflowEvent_EventReference{ @@ -789,7 +789,7 @@ func (s *NexusWorkflowTestSuite) TestNexusOperationAsyncCompletionBeforeStart() } pollResp, err := s.FrontendClient().PollWorkflowTaskQueue(ctx, &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{ Name: taskQueue, Kind: enumspb.TASK_QUEUE_KIND_NORMAL, @@ -818,7 +818,7 @@ func (s *NexusWorkflowTestSuite) TestNexusOperationAsyncCompletionBeforeStart() // Poll for the Nexus task res, err := s.FrontendClient().PollNexusTaskQueue(ctx, &workflowservice.PollNexusTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Identity: uuid.NewString(), TaskQueue: &taskqueuepb.TaskQueue{ Name: taskQueue, @@ -847,7 +847,7 @@ func (s *NexusWorkflowTestSuite) TestNexusOperationAsyncCompletionBeforeStart() // Complete workflow containing callback pollResp, err = s.FrontendClient().PollWorkflowTaskQueue(ctx, &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{ Name: completionWFTaskQueue, Kind: enumspb.TASK_QUEUE_KIND_NORMAL, @@ -877,7 +877,7 @@ func (s *NexusWorkflowTestSuite) TestNexusOperationAsyncCompletionBeforeStart() // Poll and verify the fabricated start event and completion event are recorded and triggers workflow progress. pollResp, err = s.FrontendClient().PollWorkflowTaskQueue(ctx, &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{ Name: taskQueue, Kind: enumspb.TASK_QUEUE_KIND_NORMAL, @@ -901,7 +901,7 @@ func (s *NexusWorkflowTestSuite) TestNexusOperationAsyncCompletionBeforeStart() // Complete start request to verify response is ignored. _, err = s.FrontendClient().RespondNexusTaskCompleted(ctx, &workflowservice.RespondNexusTaskCompletedRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Identity: uuid.NewString(), TaskToken: res.TaskToken, Response: &nexuspb.Response{ @@ -982,7 +982,7 @@ func (s *NexusWorkflowTestSuite) TestNexusOperationAsyncFailure() { s.EventuallyWithT(func(t *assert.CollectT) { pollResp, err := s.FrontendClient().PollWorkflowTaskQueue(ctx, &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{ Name: taskQueue, Kind: enumspb.TASK_QUEUE_KIND_NORMAL, @@ -1015,7 +1015,7 @@ func (s *NexusWorkflowTestSuite) TestNexusOperationAsyncFailure() { // Poll and verify that the "started" event was recorded. pollResp, err := s.FrontendClient().PollWorkflowTaskQueue(ctx, &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{ Name: taskQueue, Kind: enumspb.TASK_QUEUE_KIND_NORMAL, @@ -1040,11 +1040,11 @@ func (s *NexusWorkflowTestSuite) TestNexusOperationAsyncFailure() { res, snap := s.sendNexusCompletionRequest(ctx, s.T(), publicCallbackUrl, completion, callbackToken) s.Equal(http.StatusOK, res.StatusCode) s.Equal(1, len(snap["nexus_completion_requests"])) - s.Subset(snap["nexus_completion_requests"][0].Tags, map[string]string{"namespace": s.Namespace(), "outcome": "success"}) + s.Subset(snap["nexus_completion_requests"][0].Tags, map[string]string{"namespace": s.Namespace().String(), "outcome": "success"}) // Poll again and verify the completion is recorded and triggers workflow progress. pollResp, err = s.FrontendClient().PollWorkflowTaskQueue(ctx, &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{ Name: taskQueue, Kind: enumspb.TASK_QUEUE_KIND_NORMAL, @@ -1090,7 +1090,7 @@ func (s *NexusWorkflowTestSuite) TestNexusOperationAsyncCompletionErrors() { s.Run("ConfigDisabled", func() { s.OverrideDynamicConfig(dynamicconfig.EnableNexus, false) - publicCallbackUrl := "http://" + s.HttpAPIAddress() + "/" + commonnexus.RouteCompletionCallback.Path(s.Namespace()) + publicCallbackUrl := "http://" + s.HttpAPIAddress() + "/" + commonnexus.RouteCompletionCallback.Path(s.Namespace().String()) res, snap := s.sendNexusCompletionRequest(ctx, s.T(), publicCallbackUrl, completion, "") s.Equal(http.StatusNotFound, res.StatusCode) s.Equal(1, len(snap["nexus_completion_request_preprocess_errors"])) @@ -1104,16 +1104,16 @@ func (s *NexusWorkflowTestSuite) TestNexusOperationAsyncCompletionErrors() { }) s.Run("InvalidToken", func() { - publicCallbackUrl := "http://" + s.HttpAPIAddress() + "/" + commonnexus.RouteCompletionCallback.Path(s.Namespace()) + publicCallbackUrl := "http://" + s.HttpAPIAddress() + "/" + commonnexus.RouteCompletionCallback.Path(s.Namespace().String()) res, snap := s.sendNexusCompletionRequest(ctx, s.T(), publicCallbackUrl, completion, "") s.Equal(http.StatusBadRequest, res.StatusCode) s.Equal(0, len(snap["nexus_completion_request_preprocess_errors"])) s.Equal(1, len(snap["nexus_completion_requests"])) - s.Subset(snap["nexus_completion_requests"][0].Tags, map[string]string{"namespace": s.Namespace(), "outcome": "error_bad_request"}) + s.Subset(snap["nexus_completion_requests"][0].Tags, map[string]string{"namespace": s.Namespace().String(), "outcome": "error_bad_request"}) }) s.Run("InvalidClientVersion", func() { - publicCallbackUrl := "http://" + s.HttpAPIAddress() + "/" + commonnexus.RouteCompletionCallback.Path(s.Namespace()) + publicCallbackUrl := "http://" + s.HttpAPIAddress() + "/" + commonnexus.RouteCompletionCallback.Path(s.Namespace().String()) capture := s.GetTestCluster().Host().CaptureMetricsHandler().StartCapture() defer s.GetTestCluster().Host().CaptureMetricsHandler().StopCapture(capture) @@ -1130,7 +1130,7 @@ func (s *NexusWorkflowTestSuite) TestNexusOperationAsyncCompletionErrors() { snap := capture.Snapshot() s.Equal(http.StatusBadRequest, res.StatusCode) s.Equal(1, len(snap["nexus_completion_requests"])) - s.Subset(snap["nexus_completion_requests"][0].Tags, map[string]string{"namespace": s.Namespace(), "outcome": "unsupported_client"}) + s.Subset(snap["nexus_completion_requests"][0].Tags, map[string]string{"namespace": s.Namespace().String(), "outcome": "unsupported_client"}) }) } @@ -1151,11 +1151,11 @@ func (s *NexusWorkflowTestSuite) TestNexusOperationAsyncCompletionAuthErrors() { }) s.NoError(err) - publicCallbackUrl := "http://" + s.HttpAPIAddress() + "/" + commonnexus.RouteCompletionCallback.Path(s.Namespace()) + publicCallbackUrl := "http://" + s.HttpAPIAddress() + "/" + commonnexus.RouteCompletionCallback.Path(s.Namespace().String()) res, snap := s.sendNexusCompletionRequest(ctx, s.T(), publicCallbackUrl, completion, "") s.Equal(http.StatusForbidden, res.StatusCode) s.Equal(1, len(snap["nexus_completion_requests"])) - s.Subset(snap["nexus_completion_requests"][0].Tags, map[string]string{"namespace": s.Namespace(), "outcome": "error_unauthorized"}) + s.Subset(snap["nexus_completion_requests"][0].Tags, map[string]string{"namespace": s.Namespace().String(), "outcome": "error_unauthorized"}) } func (s *NexusWorkflowTestSuite) TestNexusOperationAsyncCompletionInternalAuth() { @@ -1174,7 +1174,7 @@ func (s *NexusWorkflowTestSuite) TestNexusOperationAsyncCompletionInternalAuth() Target: &nexuspb.EndpointTarget{ Variant: &nexuspb.EndpointTarget_Worker_{ Worker: &nexuspb.EndpointTarget_Worker{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, }, }, @@ -1192,7 +1192,7 @@ func (s *NexusWorkflowTestSuite) TestNexusOperationAsyncCompletionInternalAuth() completionWFTaskQueue := testcore.RandomizeStr(s.T().Name()) completionWFStartReq := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.NewString(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: testcore.RandomizeStr(s.T().Name()), WorkflowType: &commonpb.WorkflowType{Name: completionWFType}, TaskQueue: &taskqueuepb.TaskQueue{Name: completionWFTaskQueue, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, @@ -1233,7 +1233,7 @@ func (s *NexusWorkflowTestSuite) TestNexusOperationAsyncCompletionInternalAuth() }) pollResp, err := s.FrontendClient().PollWorkflowTaskQueue(ctx, &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{ Name: taskQueue, Kind: enumspb.TASK_QUEUE_KIND_NORMAL, @@ -1262,7 +1262,7 @@ func (s *NexusWorkflowTestSuite) TestNexusOperationAsyncCompletionInternalAuth() // Poll and verify that the "started" event was recorded. pollResp, err = s.FrontendClient().PollWorkflowTaskQueue(ctx, &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{ Name: taskQueue, Kind: enumspb.TASK_QUEUE_KIND_NORMAL, @@ -1282,7 +1282,7 @@ func (s *NexusWorkflowTestSuite) TestNexusOperationAsyncCompletionInternalAuth() // Complete workflow containing callback pollResp, err = s.FrontendClient().PollWorkflowTaskQueue(ctx, &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{ Name: completionWFTaskQueue, Kind: enumspb.TASK_QUEUE_KIND_NORMAL, @@ -1312,7 +1312,7 @@ func (s *NexusWorkflowTestSuite) TestNexusOperationAsyncCompletionInternalAuth() // Poll again and verify the completion is recorded and triggers workflow progress. pollResp, err = s.FrontendClient().PollWorkflowTaskQueue(ctx, &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{ Name: taskQueue, Kind: enumspb.TASK_QUEUE_KIND_NORMAL, @@ -1395,7 +1395,7 @@ func (s *NexusWorkflowTestSuite) TestNexusOperationCancelBeforeStarted_Cancelati s.NoError(err) pollResp, err := s.FrontendClient().PollWorkflowTaskQueue(ctx, &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{ Name: taskQueue, Kind: enumspb.TASK_QUEUE_KIND_NORMAL, @@ -1434,7 +1434,7 @@ func (s *NexusWorkflowTestSuite) TestNexusOperationCancelBeforeStarted_Cancelati // Poll and cancel the operation. pollResp, err = s.FrontendClient().PollWorkflowTaskQueue(ctx, &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{ Name: taskQueue, Kind: enumspb.TASK_QUEUE_KIND_NORMAL, @@ -1511,7 +1511,7 @@ func (s *NexusWorkflowTestSuite) TestNexusOperationAsyncCompletionAfterReset() { s.NoError(err) pollResp, err := s.FrontendClient().PollWorkflowTaskQueue(ctx, &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{ Name: taskQueue, Kind: enumspb.TASK_QUEUE_KIND_NORMAL, @@ -1540,7 +1540,7 @@ func (s *NexusWorkflowTestSuite) TestNexusOperationAsyncCompletionAfterReset() { // Poll and verify that the "started" event was recorded. pollResp, err = s.FrontendClient().PollWorkflowTaskQueue(ctx, &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{ Name: taskQueue, Kind: enumspb.TASK_QUEUE_KIND_NORMAL, @@ -1565,7 +1565,7 @@ func (s *NexusWorkflowTestSuite) TestNexusOperationAsyncCompletionAfterReset() { // Reset the workflow and check that the started event has been reapplied. resetResp, err := s.FrontendClient().ResetWorkflowExecution(ctx, &workflowservice.ResetWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: pollResp.WorkflowExecution, Reason: "test", RequestId: uuid.NewString(), @@ -1594,7 +1594,7 @@ func (s *NexusWorkflowTestSuite) TestNexusOperationAsyncCompletionAfterReset() { // Poll again and verify the completion is recorded and triggers workflow progress. pollResp, err = s.FrontendClient().PollWorkflowTaskQueue(ctx, &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{ Name: taskQueue, Kind: enumspb.TASK_QUEUE_KIND_NORMAL, @@ -1646,7 +1646,7 @@ func (s *NexusWorkflowTestSuite) TestNexusAsyncOperationWithNilIO() { Target: &nexuspb.EndpointTarget{ Variant: &nexuspb.EndpointTarget_Worker_{ Worker: &nexuspb.EndpointTarget_Worker{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: callerTaskQueue, }, }, @@ -1695,7 +1695,7 @@ func (s *NexusWorkflowTestSuite) TestNexusAsyncOperationWithNilIO() { s.NoError(err) pollRes, err := s.FrontendClient().PollWorkflowTaskQueue(ctx, &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{ Name: handlerWorkflowTaskQueue, }, @@ -1703,7 +1703,7 @@ func (s *NexusWorkflowTestSuite) TestNexusAsyncOperationWithNilIO() { }) s.NoError(err) _, err = s.FrontendClient().RespondWorkflowTaskCompleted(ctx, &workflowservice.RespondWorkflowTaskCompletedRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskToken: pollRes.TaskToken, Identity: "test", Commands: []*commandpb.Command{ @@ -1744,7 +1744,7 @@ func (s *NexusWorkflowTestSuite) TestNexusSyncOperationErrorRehydration() { Target: &nexuspb.EndpointTarget{ Variant: &nexuspb.EndpointTarget_Worker_{ Worker: &nexuspb.EndpointTarget_Worker{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, }, }, @@ -1903,7 +1903,7 @@ func (s *NexusWorkflowTestSuite) TestNexusAsyncOperationErrorRehydration() { Target: &nexuspb.EndpointTarget{ Variant: &nexuspb.EndpointTarget_Worker_{ Worker: &nexuspb.EndpointTarget_Worker{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, }, }, diff --git a/tests/query_workflow_test.go b/tests/query_workflow_test.go index 3bab90f1378..92a5c762a97 100644 --- a/tests/query_workflow_test.go +++ b/tests/query_workflow_test.go @@ -385,7 +385,7 @@ func (s *QueryWorkflowSuite) TestQueryWorkflow_FailurePropagated() { // Query the workflow in the background to have the query delivered with the first workflow task in the Queries map. go func() { _, err := s.FrontendClient().QueryWorkflow(ctx, &workflowservice.QueryWorkflowRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: &commonpb.WorkflowExecution{ WorkflowId: workflowRun.GetID(), }, @@ -401,7 +401,7 @@ func (s *QueryWorkflowSuite) TestQueryWorkflow_FailurePropagated() { util.InterruptibleSleep(ctx, 3*time.Second) task, err := s.FrontendClient().PollWorkflowTaskQueue(ctx, &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{Name: taskQueue}, Identity: s.T().Name(), }) @@ -446,7 +446,7 @@ func (s *QueryWorkflowSuite) TestQueryWorkflow_FailurePropagated() { // API. go func() { task, err := s.FrontendClient().PollWorkflowTaskQueue(ctx, &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{Name: taskQueue}, Identity: s.T().Name(), }) @@ -456,7 +456,7 @@ func (s *QueryWorkflowSuite) TestQueryWorkflow_FailurePropagated() { } _, err = s.FrontendClient().RespondQueryTaskCompleted(ctx, &workflowservice.RespondQueryTaskCompletedRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskToken: task.TaskToken, CompletedType: enumspb.QUERY_RESULT_TYPE_FAILED, ErrorMessage: "my error message", @@ -469,7 +469,7 @@ func (s *QueryWorkflowSuite) TestQueryWorkflow_FailurePropagated() { }() _, err = s.FrontendClient().QueryWorkflow(ctx, &workflowservice.QueryWorkflowRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: &commonpb.WorkflowExecution{ WorkflowId: workflowRun.GetID(), }, diff --git a/tests/relay_task_test.go b/tests/relay_task_test.go index 1984675d917..466f3bbb636 100644 --- a/tests/relay_task_test.go +++ b/tests/relay_task_test.go @@ -58,7 +58,7 @@ func (s *RelayTaskTestSuite) TestRelayWorkflowTaskTimeout() { // Start workflow execution request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: &commonpb.WorkflowType{Name: wt}, TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, @@ -96,7 +96,7 @@ func (s *RelayTaskTestSuite) TestRelayWorkflowTaskTimeout() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -120,7 +120,7 @@ func (s *RelayTaskTestSuite) TestRelayWorkflowTaskTimeout() { time.Sleep(time.Second * 2) // wait 2s for relay workflow task to timeout workflowTaskTimeout := false for i := 0; i < 3; i++ { - events := s.GetHistory(s.Namespace(), workflowExecution) + events := s.GetHistory(s.Namespace().String(), workflowExecution) if len(events) == 8 { s.EqualHistoryEvents(` 1 WorkflowExecutionStarted diff --git a/tests/reset_workflow_test.go b/tests/reset_workflow_test.go index fa148aab53b..ea0ed8a678b 100644 --- a/tests/reset_workflow_test.go +++ b/tests/reset_workflow_test.go @@ -78,7 +78,7 @@ func (s *ResetWorkflowTestSuite) TestResetWorkflow() { // Start workflow execution request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -155,7 +155,7 @@ func (s *ResetWorkflowTestSuite) TestResetWorkflow() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -180,7 +180,7 @@ func (s *ResetWorkflowTestSuite) TestResetWorkflow() { s.NoError(err) // Find reset point (last completed workflow task) - events := s.GetHistory(s.Namespace(), &commonpb.WorkflowExecution{ + events := s.GetHistory(s.Namespace().String(), &commonpb.WorkflowExecution{ WorkflowId: id, RunId: we.GetRunId(), }) @@ -193,7 +193,7 @@ func (s *ResetWorkflowTestSuite) TestResetWorkflow() { // Reset workflow execution resetResp, err := s.FrontendClient().ResetWorkflowExecution(testcore.NewContext(), &workflowservice.ResetWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: &commonpb.WorkflowExecution{ WorkflowId: id, RunId: we.RunId, @@ -220,7 +220,7 @@ func (s *ResetWorkflowTestSuite) TestResetWorkflow() { s.True(workflowComplete) descResp, err := s.FrontendClient().DescribeWorkflowExecution(testcore.NewContext(), &workflowservice.DescribeWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: &commonpb.WorkflowExecution{ WorkflowId: id, RunId: resetResp.GetRunId(), @@ -246,7 +246,7 @@ func (s *ResetWorkflowTestSuite) runWorkflowWithPoller(tv *testvars.TestVars) [] poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tv.TaskQueue(), Identity: tv.WorkerIdentity(), WorkflowTaskHandler: wtHandler, @@ -266,7 +266,7 @@ func (s *ResetWorkflowTestSuite) TestResetWorkflowAfterTimeout() { request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: tv.WorkflowID(), WorkflowType: tv.WorkflowType(), TaskQueue: tv.TaskQueue(), @@ -283,7 +283,7 @@ func (s *ResetWorkflowTestSuite) TestResetWorkflowAfterTimeout() { var historyEvents []*historypb.HistoryEvent s.Eventually(func() bool { - historyEvents = s.GetHistory(s.Namespace(), &commonpb.WorkflowExecution{ + historyEvents = s.GetHistory(s.Namespace().String(), &commonpb.WorkflowExecution{ WorkflowId: tv.WorkflowID(), RunId: we.RunId, }) @@ -305,7 +305,7 @@ func (s *ResetWorkflowTestSuite) TestResetWorkflowAfterTimeout() { closedCount := 0 s.Eventually(func() bool { resp, err := s.FrontendClient().ListClosedWorkflowExecutions(testcore.NewContext(), &workflowservice.ListClosedWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), MaximumPageSize: 100, StartTimeFilter: &filterpb.StartTimeFilter{ EarliestTime: timestamppb.New(startTime), @@ -330,7 +330,7 @@ func (s *ResetWorkflowTestSuite) TestResetWorkflowAfterTimeout() { time.Sleep(time.Second) //nolint:forbidigo _, err = s.FrontendClient().ResetWorkflowExecution(testcore.NewContext(), &workflowservice.ResetWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: &commonpb.WorkflowExecution{ WorkflowId: tv.WorkflowID(), RunId: we.RunId, @@ -343,7 +343,7 @@ func (s *ResetWorkflowTestSuite) TestResetWorkflowAfterTimeout() { executions := s.runWorkflowWithPoller(tv) - events := s.GetHistory(s.Namespace(), executions[0]) + events := s.GetHistory(s.Namespace().String(), executions[0]) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted {"Attempt":1} @@ -440,7 +440,7 @@ type resetTest struct { func (t *resetTest) sendSignalAndProcessWFT(poller *testcore.TaskPoller) { signalRequest := &workflowservice.SignalWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: t.Namespace(), + Namespace: t.Namespace().String(), WorkflowExecution: t.tv.WorkflowExecution(), SignalName: t.tv.HandlerName(), Input: t.tv.Any().Payloads(), @@ -525,7 +525,7 @@ func (t *resetTest) wftHandler(task *workflowservice.PollWorkflowTaskQueueRespon func (t *resetTest) reset(eventId int64) string { resp, err := t.FrontendClient().ResetWorkflowExecution(testcore.NewContext(), &workflowservice.ResetWorkflowExecutionRequest{ - Namespace: t.Namespace(), + Namespace: t.Namespace().String(), WorkflowExecution: t.tv.WorkflowExecution(), Reason: "reset execution from test", WorkflowTaskFinishEventId: eventId, @@ -544,7 +544,7 @@ func (t *resetTest) run() { poller := &testcore.TaskPoller{ Client: t.FrontendClient(), - Namespace: t.Namespace(), + Namespace: t.Namespace().String(), TaskQueue: t.tv.TaskQueue(), Identity: t.tv.WorkerIdentity(), WorkflowTaskHandler: t.wftHandler, @@ -561,7 +561,7 @@ func (t *resetTest) run() { 2 WorkflowTaskScheduled 3 WorkflowTaskStarted 4 WorkflowTaskCompleted -`, t.GetHistory(t.Namespace(), t.tv.WorkflowExecution())) +`, t.GetHistory(t.Namespace().String(), t.tv.WorkflowExecution())) for i := 1; i <= t.totalSignals; i++ { t.sendSignalAndProcessWFT(poller) @@ -594,12 +594,12 @@ func (t *resetTest) run() { 19 WorkflowTaskCompleted 20 WorkflowExecutionUpdateAccepted 21 WorkflowExecutionCompleted -`, t.GetHistory(t.Namespace(), t.tv.WorkflowExecution())) +`, t.GetHistory(t.Namespace().String(), t.tv.WorkflowExecution())) resetToEventId := int64(4) newRunId := t.reset(resetToEventId) t.tv = t.tv.WithRunID(newRunId) - events := t.GetHistory(t.Namespace(), t.tv.WorkflowExecution()) + events := t.GetHistory(t.Namespace().String(), t.tv.WorkflowExecution()) resetReapplyExcludeTypes := resetworkflow.GetResetReapplyExcludeTypes(t.reapplyExcludeTypes, t.reapplyType) _, noSignals := resetReapplyExcludeTypes[enumspb.RESET_REAPPLY_EXCLUDE_TYPE_SIGNAL] @@ -650,7 +650,7 @@ func (t *resetTest) run() { resetToEventId := int64(4) newRunId := t.reset(resetToEventId) t.tv = t.tv.WithRunID(newRunId) - events = t.GetHistory(t.Namespace(), t.tv.WorkflowExecution()) + events = t.GetHistory(t.Namespace().String(), t.tv.WorkflowExecution()) t.EqualHistoryEvents(` 1 WorkflowExecutionStarted 2 WorkflowTaskScheduled @@ -701,7 +701,7 @@ func (s *ResetWorkflowTestSuite) testResetWorkflowSignalReapplyBuffer( _, err := s.FrontendClient().SignalWorkflowExecution(testcore.NewContext(), &workflowservice.SignalWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: &commonpb.WorkflowExecution{ WorkflowId: tv.WorkflowID(), RunId: tv.RunID(), @@ -717,7 +717,7 @@ func (s *ResetWorkflowTestSuite) testResetWorkflowSignalReapplyBuffer( // (2) send Reset resp, err := s.FrontendClient().ResetWorkflowExecution(testcore.NewContext(), &workflowservice.ResetWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: &commonpb.WorkflowExecution{ WorkflowId: tv.WorkflowID(), RunId: tv.RunID(), @@ -745,7 +745,7 @@ func (s *ResetWorkflowTestSuite) testResetWorkflowSignalReapplyBuffer( poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tv.TaskQueue(), Identity: tv.WorkerIdentity(), WorkflowTaskHandler: wtHandler, @@ -761,7 +761,7 @@ func (s *ResetWorkflowTestSuite) testResetWorkflowSignalReapplyBuffer( s.Logger.Info("PollAndProcessWorkflowTask", tag.Error(err)) s.NoError(err) - events := s.GetHistory(s.Namespace(), &commonpb.WorkflowExecution{WorkflowId: tv.WorkflowID(), RunId: resetRunID}) + events := s.GetHistory(s.Namespace().String(), &commonpb.WorkflowExecution{WorkflowId: tv.WorkflowID(), RunId: resetRunID}) switch reapplyType { // nolint:exhaustive case enumspb.RESET_REAPPLY_TYPE_SIGNAL: s.EqualHistoryEvents(` @@ -826,7 +826,7 @@ func (s *ResetWorkflowTestSuite) testResetWorkflowRangeScheduleToStart( // Start workflow execution request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: workflowID, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -840,7 +840,7 @@ func (s *ResetWorkflowTestSuite) testResetWorkflowRangeScheduleToStart( s.NoError(err) _, err = s.FrontendClient().SignalWorkflowExecution(testcore.NewContext(), &workflowservice.SignalWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: &commonpb.WorkflowExecution{ WorkflowId: workflowID, RunId: we.RunId, @@ -876,7 +876,7 @@ func (s *ResetWorkflowTestSuite) testResetWorkflowRangeScheduleToStart( poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -898,7 +898,7 @@ func (s *ResetWorkflowTestSuite) testResetWorkflowRangeScheduleToStart( // Reset workflow execution _, err = s.FrontendClient().ResetWorkflowExecution(testcore.NewContext(), &workflowservice.ResetWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: &commonpb.WorkflowExecution{ WorkflowId: workflowID, RunId: we.RunId, @@ -931,7 +931,7 @@ func (s *ResetWorkflowTestSuite) TestResetWorkflow_ResetAfterContinueAsNew() { // get sdkClient sdkClient, err := sdkclient.Dial(sdkclient.Options{ HostPort: s.FrontendGRPCAddress(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), }) if err != nil { s.Logger.Fatal("Error when creating SDK client", tag.Error(err)) @@ -948,7 +948,7 @@ func (s *ResetWorkflowTestSuite) TestResetWorkflow_ResetAfterContinueAsNew() { // wait for your workflow and its CaN to complete s.Eventually(func() bool { resp, err := s.FrontendClient().CountWorkflowExecutions(ctx, &workflowservice.CountWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Query: fmt.Sprintf("WorkflowId = \"%s\" AND ExecutionStatus != \"Running\"", run.GetID()), }) s.NoError(err) @@ -961,7 +961,7 @@ func (s *ResetWorkflowTestSuite) TestResetWorkflow_ResetAfterContinueAsNew() { } // Find reset point (last completed workflow task) - events := s.GetHistory(s.Namespace(), wfExec) + events := s.GetHistory(s.Namespace().String(), wfExec) var lastWorkflowTask *historypb.HistoryEvent for _, event := range events { if event.GetEventType() == enumspb.EVENT_TYPE_WORKFLOW_TASK_COMPLETED { @@ -971,7 +971,7 @@ func (s *ResetWorkflowTestSuite) TestResetWorkflow_ResetAfterContinueAsNew() { // reset the original workflow _, err = s.FrontendClient().ResetWorkflowExecution(ctx, &workflowservice.ResetWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: wfExec, WorkflowTaskFinishEventId: lastWorkflowTask.GetEventId(), RequestId: uuid.New(), diff --git a/tests/schedule_test.go b/tests/schedule_test.go index 7c2cd78cef3..cafebcde0b5 100644 --- a/tests/schedule_test.go +++ b/tests/schedule_test.go @@ -111,7 +111,7 @@ func (s *ScheduleFunctionalSuite) SetupTest() { s.dataConverter = testcore.NewTestDataConverter() sdkClient, err := sdkclient.Dial(sdkclient.Options{ HostPort: s.FrontendGRPCAddress(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), DataConverter: s.dataConverter, }) if err != nil { @@ -180,7 +180,7 @@ func (s *ScheduleFunctionalSuite) TestBasics() { }, } req := &workflowservice.CreateScheduleRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), ScheduleId: sid, Schedule: schedule, Identity: "test", @@ -229,7 +229,7 @@ func (s *ScheduleFunctionalSuite) TestBasics() { // describe describeResp, err := s.FrontendClient().DescribeSchedule(testcore.NewContext(), &workflowservice.DescribeScheduleRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), ScheduleId: sid, }) s.NoError(err) @@ -306,7 +306,7 @@ func (s *ScheduleFunctionalSuite) TestBasics() { // list workflows wfResp, err := s.FrontendClient().ListWorkflowExecutions(testcore.NewContext(), &workflowservice.ListWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), PageSize: 5, Query: "", }) @@ -332,7 +332,7 @@ func (s *ScheduleFunctionalSuite) TestBasics() { // list with QueryWithAnyNamespaceDivision, we should see the scheduler workflow wfResp, err = s.FrontendClient().ListWorkflowExecutions(testcore.NewContext(), &workflowservice.ListWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), PageSize: 5, Query: searchattribute.QueryWithAnyNamespaceDivision(`ExecutionStatus = "Running"`), }) @@ -348,7 +348,7 @@ func (s *ScheduleFunctionalSuite) TestBasics() { // list workflows with an exact match on namespace division (implementation details here, not public api) wfResp, err = s.FrontendClient().ListWorkflowExecutions(testcore.NewContext(), &workflowservice.ListWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), PageSize: 5, Query: fmt.Sprintf("%s = '%s'", searchattribute.TemporalNamespaceDivision, scheduler.NamespaceDivision), }) @@ -360,7 +360,7 @@ func (s *ScheduleFunctionalSuite) TestBasics() { // list schedules with search attribute filter listResp, err := s.FrontendClient().ListSchedules(testcore.NewContext(), &workflowservice.ListSchedulesRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), MaximumPageSize: 5, Query: "CustomKeywordField = 'schedule sa value' AND TemporalSchedulePaused = false", }) @@ -372,7 +372,7 @@ func (s *ScheduleFunctionalSuite) TestBasics() { // list schedules with invalid search attribute filter _, err = s.FrontendClient().ListSchedules(testcore.NewContext(), &workflowservice.ListSchedulesRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), MaximumPageSize: 5, Query: "ExecutionDuration > '1s'", }) @@ -385,7 +385,7 @@ func (s *ScheduleFunctionalSuite) TestBasics() { updateTime := time.Now() _, err = s.FrontendClient().UpdateSchedule(testcore.NewContext(), &workflowservice.UpdateScheduleRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), ScheduleId: sid, Schedule: schedule, Identity: "test", @@ -404,7 +404,7 @@ func (s *ScheduleFunctionalSuite) TestBasics() { describeResp, err = s.FrontendClient().DescribeSchedule( testcore.NewContext(), &workflowservice.DescribeScheduleRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), ScheduleId: sid, }, ) @@ -431,7 +431,7 @@ func (s *ScheduleFunctionalSuite) TestBasics() { schSADoubleValue, _ := payload.Encode(3.14) schSAIntValue, _ = payload.Encode(321) _, err = s.FrontendClient().UpdateSchedule(testcore.NewContext(), &workflowservice.UpdateScheduleRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), ScheduleId: sid, Schedule: schedule, Identity: "test", @@ -453,7 +453,7 @@ func (s *ScheduleFunctionalSuite) TestBasics() { describeResp, err = s.FrontendClient().DescribeSchedule( testcore.NewContext(), &workflowservice.DescribeScheduleRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), ScheduleId: sid, }, ) @@ -474,7 +474,7 @@ func (s *ScheduleFunctionalSuite) TestBasics() { schedule.Action.GetStartWorkflow().WorkflowType.Name = wt2 _, err = s.FrontendClient().UpdateSchedule(testcore.NewContext(), &workflowservice.UpdateScheduleRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), ScheduleId: sid, Schedule: schedule, Identity: "test", @@ -489,7 +489,7 @@ func (s *ScheduleFunctionalSuite) TestBasics() { describeResp, err = s.FrontendClient().DescribeSchedule( testcore.NewContext(), &workflowservice.DescribeScheduleRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), ScheduleId: sid, }, ) @@ -503,7 +503,7 @@ func (s *ScheduleFunctionalSuite) TestBasics() { // pause _, err = s.FrontendClient().PatchSchedule(testcore.NewContext(), &workflowservice.PatchScheduleRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), ScheduleId: sid, Patch: &schedulepb.SchedulePatch{ Pause: "because I said so", @@ -517,7 +517,7 @@ func (s *ScheduleFunctionalSuite) TestBasics() { s.EqualValues(1, atomic.LoadInt32(&runs2), "has not run again") describeResp, err = s.FrontendClient().DescribeSchedule(testcore.NewContext(), &workflowservice.DescribeScheduleRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), ScheduleId: sid, }) s.NoError(err) @@ -527,7 +527,7 @@ func (s *ScheduleFunctionalSuite) TestBasics() { // don't loop to wait for visibility, we already waited 7s from the patch listResp, err = s.FrontendClient().ListSchedules(testcore.NewContext(), &workflowservice.ListSchedulesRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), MaximumPageSize: 5, }) s.NoError(err) @@ -540,21 +540,21 @@ func (s *ScheduleFunctionalSuite) TestBasics() { // finally delete _, err = s.FrontendClient().DeleteSchedule(testcore.NewContext(), &workflowservice.DeleteScheduleRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), ScheduleId: sid, Identity: "test", }) s.NoError(err) describeResp, err = s.FrontendClient().DescribeSchedule(testcore.NewContext(), &workflowservice.DescribeScheduleRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), ScheduleId: sid, }) s.Error(err) s.Eventually(func() bool { // wait for visibility listResp, err := s.FrontendClient().ListSchedules(testcore.NewContext(), &workflowservice.ListSchedulesRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), MaximumPageSize: 5, }) s.NoError(err) @@ -598,7 +598,7 @@ func (s *ScheduleFunctionalSuite) TestInput() { }, } req := &workflowservice.CreateScheduleRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), ScheduleId: sid, Schedule: schedule, Identity: "test", @@ -646,7 +646,7 @@ func (s *ScheduleFunctionalSuite) TestLastCompletionAndError() { }, } req := &workflowservice.CreateScheduleRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), ScheduleId: sid, Schedule: schedule, Identity: "test", @@ -724,7 +724,7 @@ func (s *ScheduleFunctionalSuite) TestRefresh() { }, } req := &workflowservice.CreateScheduleRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), ScheduleId: sid, Schedule: schedule, Identity: "test", @@ -751,13 +751,13 @@ func (s *ScheduleFunctionalSuite) TestRefresh() { // workflow has started but is now sleeping. it will timeout in 2 seconds. describeResp, err := s.FrontendClient().DescribeSchedule(testcore.NewContext(), &workflowservice.DescribeScheduleRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), ScheduleId: sid, }) s.NoError(err) s.EqualValues(1, len(describeResp.Info.RunningWorkflows)) - events1 := s.GetHistory(s.Namespace(), &commonpb.WorkflowExecution{WorkflowId: scheduler.WorkflowIDPrefix + sid}) + events1 := s.GetHistory(s.Namespace().String(), &commonpb.WorkflowExecution{WorkflowId: scheduler.WorkflowIDPrefix + sid}) expectedHistory := ` 1 WorkflowExecutionStarted 2 WorkflowTaskScheduled @@ -782,12 +782,12 @@ func (s *ScheduleFunctionalSuite) TestRefresh() { // now it has timed out, but the scheduler hasn't noticed yet. we can prove it by checking // its history. - events2 := s.GetHistory(s.Namespace(), &commonpb.WorkflowExecution{WorkflowId: scheduler.WorkflowIDPrefix + sid}) + events2 := s.GetHistory(s.Namespace().String(), &commonpb.WorkflowExecution{WorkflowId: scheduler.WorkflowIDPrefix + sid}) s.EqualHistoryEvents(expectedHistory, events2) // when we describe we'll force a refresh and see it timed out describeResp, err = s.FrontendClient().DescribeSchedule(testcore.NewContext(), &workflowservice.DescribeScheduleRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), ScheduleId: sid, }) s.NoError(err) @@ -795,7 +795,7 @@ func (s *ScheduleFunctionalSuite) TestRefresh() { // check scheduler has gotten the refresh and done some stuff. signal is sent without waiting so we need to wait. s.Eventually(func() bool { - events3 := s.GetHistory(s.Namespace(), &commonpb.WorkflowExecution{WorkflowId: scheduler.WorkflowIDPrefix + sid}) + events3 := s.GetHistory(s.Namespace().String(), &commonpb.WorkflowExecution{WorkflowId: scheduler.WorkflowIDPrefix + sid}) return len(events3) > len(events2) }, 5*time.Second, 100*time.Millisecond) } @@ -825,7 +825,7 @@ func (s *ScheduleFunctionalSuite) TestListBeforeRun() { }, } req := &workflowservice.CreateScheduleRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), ScheduleId: sid, Schedule: schedule, Identity: "test", @@ -884,7 +884,7 @@ func (s *ScheduleFunctionalSuite) TestRateLimit() { }, } _, err := s.FrontendClient().CreateSchedule(testcore.NewContext(), &workflowservice.CreateScheduleRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), ScheduleId: fmt.Sprintf(sid, i), Schedule: schedule, Identity: "test", @@ -945,7 +945,7 @@ func (s *ScheduleFunctionalSuite) TestListSchedulesReturnsWorkflowStatus() { s.worker.RegisterWorkflowWithOptions(workflowFn, workflow.RegisterOptions{Name: wt}) req := &workflowservice.CreateScheduleRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), ScheduleId: sid, Schedule: schedule, InitialPatch: patch, @@ -967,7 +967,7 @@ func (s *ScheduleFunctionalSuite) TestListSchedulesReturnsWorkflowStatus() { // let the started workflow complete _, err = s.FrontendClient().SignalWorkflowExecution(testcore.NewContext(), &workflowservice.SignalWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: &commonpb.WorkflowExecution{ WorkflowId: a1.StartWorkflowResult.WorkflowId, RunId: a1.StartWorkflowResult.RunId, @@ -988,7 +988,7 @@ func (s *ScheduleFunctionalSuite) TestListSchedulesReturnsWorkflowStatus() { // Also verify that DescribeSchedule's output matches descResp, err := s.FrontendClient().DescribeSchedule(testcore.NewContext(), &workflowservice.DescribeScheduleRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), ScheduleId: sid, }) s.NoError(err) @@ -1017,7 +1017,7 @@ func (s *ScheduleFunctionalSuite) TestNextTimeCache() { }, } req := &workflowservice.CreateScheduleRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), ScheduleId: sid, Schedule: schedule, Identity: "test", @@ -1044,7 +1044,7 @@ func (s *ScheduleFunctionalSuite) TestNextTimeCache() { // there should be only four side effects for 13 runs, and only two mentioning "Next" // (cache refills) - events := s.GetHistory(s.Namespace(), &commonpb.WorkflowExecution{WorkflowId: scheduler.WorkflowIDPrefix + sid}) + events := s.GetHistory(s.Namespace().String(), &commonpb.WorkflowExecution{WorkflowId: scheduler.WorkflowIDPrefix + sid}) var sideEffects, nextTimeSideEffects int for _, e := range events { if marker := e.GetMarkerRecordedEventAttributes(); marker.GetMarkerName() == "SideEffect" { @@ -1079,7 +1079,7 @@ func (s *ScheduleFunctionalSuite) getScheduleEntryFomVisibility(sid string, pred var slEntry *schedulepb.ScheduleListEntry s.Require().Eventually(func() bool { // wait for visibility listResp, err := s.FrontendClient().ListSchedules(testcore.NewContext(), &workflowservice.ListSchedulesRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), MaximumPageSize: 5, }) if err != nil { @@ -1124,7 +1124,7 @@ func (s *ScheduleFunctionalSuite) assertSameRecentActions( func (s *ScheduleFunctionalSuite) cleanup(sid string) { s.T().Cleanup(func() { _, _ = s.FrontendClient().DeleteSchedule(testcore.NewContext(), &workflowservice.DeleteScheduleRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), ScheduleId: sid, Identity: "test", }) diff --git a/tests/signal_workflow_test.go b/tests/signal_workflow_test.go index 8af25e2c862..bb68b42590f 100644 --- a/tests/signal_workflow_test.go +++ b/tests/signal_workflow_test.go @@ -80,7 +80,7 @@ func (s *SignalWorkflowTestSuite) TestSignalWorkflow() { Fields: map[string]*commonpb.Payload{"signal header key": payload.EncodeString("signal header value")}, } _, err0 := s.FrontendClient().SignalWorkflowExecution(testcore.NewContext(), &workflowservice.SignalWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: &commonpb.WorkflowExecution{ WorkflowId: id, RunId: uuid.New(), @@ -96,7 +96,7 @@ func (s *SignalWorkflowTestSuite) TestSignalWorkflow() { // Start workflow execution request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -162,7 +162,7 @@ func (s *SignalWorkflowTestSuite) TestSignalWorkflow() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -180,7 +180,7 @@ func (s *SignalWorkflowTestSuite) TestSignalWorkflow() { signalName := "my signal" signalInput := payloads.EncodeString("my signal input") _, err = s.FrontendClient().SignalWorkflowExecution(testcore.NewContext(), &workflowservice.SignalWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: &commonpb.WorkflowExecution{ WorkflowId: id, RunId: we.RunId, @@ -208,7 +208,7 @@ func (s *SignalWorkflowTestSuite) TestSignalWorkflow() { signalName = "another signal" signalInput = payloads.EncodeString("another signal input") _, err = s.FrontendClient().SignalWorkflowExecution(testcore.NewContext(), &workflowservice.SignalWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: &commonpb.WorkflowExecution{ WorkflowId: id, }, @@ -231,7 +231,7 @@ func (s *SignalWorkflowTestSuite) TestSignalWorkflow() { // Terminate workflow execution _, err = s.FrontendClient().TerminateWorkflowExecution(testcore.NewContext(), &workflowservice.TerminateWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: &commonpb.WorkflowExecution{ WorkflowId: id, }, @@ -243,7 +243,7 @@ func (s *SignalWorkflowTestSuite) TestSignalWorkflow() { // Send signal to terminated workflow _, err = s.FrontendClient().SignalWorkflowExecution(testcore.NewContext(), &workflowservice.SignalWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: &commonpb.WorkflowExecution{ WorkflowId: id, RunId: we.RunId, @@ -270,7 +270,7 @@ func (s *SignalWorkflowTestSuite) TestSignalWorkflow_DuplicateRequest() { // Start workflow execution request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -338,7 +338,7 @@ func (s *SignalWorkflowTestSuite) TestSignalWorkflow_DuplicateRequest() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -357,7 +357,7 @@ func (s *SignalWorkflowTestSuite) TestSignalWorkflow_DuplicateRequest() { signalInput := payloads.EncodeString("my signal input") requestID := uuid.New() signalReqest := &workflowservice.SignalWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: &commonpb.WorkflowExecution{ WorkflowId: id, RunId: we.RunId, @@ -409,7 +409,7 @@ func (s *SignalWorkflowTestSuite) TestSignalExternalWorkflowCommand() { request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -425,7 +425,7 @@ func (s *SignalWorkflowTestSuite) TestSignalExternalWorkflowCommand() { foreignRequest := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.ForeignNamespace(), + Namespace: s.ForeignNamespace().String(), WorkflowId: id, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -436,7 +436,7 @@ func (s *SignalWorkflowTestSuite) TestSignalExternalWorkflowCommand() { } we2, err0 := s.FrontendClient().StartWorkflowExecution(testcore.NewContext(), foreignRequest) s.NoError(err0) - s.Logger.Info("StartWorkflowExecution on foreign Namespace", tag.WorkflowNamespace(s.ForeignNamespace()), tag.WorkflowRunID(we2.RunId)) + s.Logger.Info("StartWorkflowExecution on foreign Namespace", tag.WorkflowNamespace(s.ForeignNamespace().String()), tag.WorkflowRunID(we2.RunId)) activityCount := int32(1) activityCounter := int32(0) @@ -469,7 +469,7 @@ func (s *SignalWorkflowTestSuite) TestSignalExternalWorkflowCommand() { return []*commandpb.Command{{ CommandType: enumspb.COMMAND_TYPE_SIGNAL_EXTERNAL_WORKFLOW_EXECUTION, Attributes: &commandpb.Command_SignalExternalWorkflowExecutionCommandAttributes{SignalExternalWorkflowExecutionCommandAttributes: &commandpb.SignalExternalWorkflowExecutionCommandAttributes{ - Namespace: s.ForeignNamespace(), + Namespace: s.ForeignNamespace().String(), Execution: &commonpb.WorkflowExecution{ WorkflowId: id, RunId: we2.GetRunId(), @@ -487,7 +487,7 @@ func (s *SignalWorkflowTestSuite) TestSignalExternalWorkflowCommand() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -539,7 +539,7 @@ func (s *SignalWorkflowTestSuite) TestSignalExternalWorkflowCommand() { foreignPoller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.ForeignNamespace(), + Namespace: s.ForeignNamespace().String(), TaskQueue: taskQueue, Identity: identity, WorkflowTaskHandler: foreignwtHandler, @@ -570,7 +570,7 @@ func (s *SignalWorkflowTestSuite) TestSignalExternalWorkflowCommand() { var historyEvents []*historypb.HistoryEvent CheckHistoryLoopForSignalSent: for i := 1; i < 10; i++ { - historyEvents = s.GetHistory(s.Namespace(), &commonpb.WorkflowExecution{ + historyEvents = s.GetHistory(s.Namespace().String(), &commonpb.WorkflowExecution{ WorkflowId: id, RunId: we.RunId, }) @@ -625,7 +625,7 @@ func (s *SignalWorkflowTestSuite) TestSignalWorkflow_Cron_NoWorkflowTaskCreated( // Start workflow execution request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -646,7 +646,7 @@ func (s *SignalWorkflowTestSuite) TestSignalWorkflow_Cron_NoWorkflowTaskCreated( signalName := "my signal" signalInput := payloads.EncodeString("my signal input") _, err := s.FrontendClient().SignalWorkflowExecution(testcore.NewContext(), &workflowservice.SignalWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: &commonpb.WorkflowExecution{ WorkflowId: id, RunId: we.RunId, @@ -672,7 +672,7 @@ func (s *SignalWorkflowTestSuite) TestSignalWorkflow_Cron_NoWorkflowTaskCreated( poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -697,7 +697,7 @@ func (s *SignalWorkflowTestSuite) TestSignalWorkflow_WorkflowCloseAttempted() { we, err := s.FrontendClient().StartWorkflowExecution(testcore.NewContext(), &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -712,7 +712,7 @@ func (s *SignalWorkflowTestSuite) TestSignalWorkflow_WorkflowCloseAttempted() { wtHandler := func(task *workflowservice.PollWorkflowTaskQueueResponse) ([]*commandpb.Command, error) { if attemptCount == 1 { _, err := s.FrontendClient().SignalWorkflowExecution(testcore.NewContext(), &workflowservice.SignalWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: &commonpb.WorkflowExecution{ WorkflowId: id, RunId: we.RunId, @@ -727,7 +727,7 @@ func (s *SignalWorkflowTestSuite) TestSignalWorkflow_WorkflowCloseAttempted() { if attemptCount == 2 { ctx, _ := rpc.NewContextWithTimeoutAndVersionHeaders(time.Second) _, err := s.FrontendClient().SignalWorkflowExecution(ctx, &workflowservice.SignalWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: &commonpb.WorkflowExecution{ WorkflowId: id, RunId: we.RunId, @@ -751,7 +751,7 @@ func (s *SignalWorkflowTestSuite) TestSignalWorkflow_WorkflowCloseAttempted() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -781,7 +781,7 @@ func (s *SignalWorkflowTestSuite) TestSignalExternalWorkflowCommand_WithoutRunID request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -797,7 +797,7 @@ func (s *SignalWorkflowTestSuite) TestSignalExternalWorkflowCommand_WithoutRunID foreignRequest := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.ForeignNamespace(), + Namespace: s.ForeignNamespace().String(), WorkflowId: id, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -808,7 +808,7 @@ func (s *SignalWorkflowTestSuite) TestSignalExternalWorkflowCommand_WithoutRunID } we2, err0 := s.FrontendClient().StartWorkflowExecution(testcore.NewContext(), foreignRequest) s.NoError(err0) - s.Logger.Info("StartWorkflowExecution on foreign Namespace", tag.WorkflowNamespace(s.ForeignNamespace()), tag.WorkflowRunID(we2.RunId)) + s.Logger.Info("StartWorkflowExecution on foreign Namespace", tag.WorkflowNamespace(s.ForeignNamespace().String()), tag.WorkflowRunID(we2.RunId)) activityCount := int32(1) activityCounter := int32(0) @@ -838,7 +838,7 @@ func (s *SignalWorkflowTestSuite) TestSignalExternalWorkflowCommand_WithoutRunID return []*commandpb.Command{{ CommandType: enumspb.COMMAND_TYPE_SIGNAL_EXTERNAL_WORKFLOW_EXECUTION, Attributes: &commandpb.Command_SignalExternalWorkflowExecutionCommandAttributes{SignalExternalWorkflowExecutionCommandAttributes: &commandpb.SignalExternalWorkflowExecutionCommandAttributes{ - Namespace: s.ForeignNamespace(), + Namespace: s.ForeignNamespace().String(), Execution: &commonpb.WorkflowExecution{ WorkflowId: id, // No RunID in command @@ -855,7 +855,7 @@ func (s *SignalWorkflowTestSuite) TestSignalExternalWorkflowCommand_WithoutRunID poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -907,7 +907,7 @@ func (s *SignalWorkflowTestSuite) TestSignalExternalWorkflowCommand_WithoutRunID foreignPoller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.ForeignNamespace(), + Namespace: s.ForeignNamespace().String(), TaskQueue: taskQueue, Identity: identity, WorkflowTaskHandler: foreignwtHandler, @@ -938,7 +938,7 @@ func (s *SignalWorkflowTestSuite) TestSignalExternalWorkflowCommand_WithoutRunID var historyEvents []*historypb.HistoryEvent CheckHistoryLoopForSignalSent: for i := 1; i < 10; i++ { - historyEvents = s.GetHistory(s.Namespace(), &commonpb.WorkflowExecution{ + historyEvents = s.GetHistory(s.Namespace().String(), &commonpb.WorkflowExecution{ WorkflowId: id, RunId: we.RunId, }) @@ -992,7 +992,7 @@ func (s *SignalWorkflowTestSuite) TestSignalExternalWorkflowCommand_UnKnownTarge request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -1033,7 +1033,7 @@ func (s *SignalWorkflowTestSuite) TestSignalExternalWorkflowCommand_UnKnownTarge return []*commandpb.Command{{ CommandType: enumspb.COMMAND_TYPE_SIGNAL_EXTERNAL_WORKFLOW_EXECUTION, Attributes: &commandpb.Command_SignalExternalWorkflowExecutionCommandAttributes{SignalExternalWorkflowExecutionCommandAttributes: &commandpb.SignalExternalWorkflowExecutionCommandAttributes{ - Namespace: s.ForeignNamespace(), + Namespace: s.ForeignNamespace().String(), Execution: &commonpb.WorkflowExecution{ WorkflowId: "workflow_not_exist", RunId: we.GetRunId(), @@ -1050,7 +1050,7 @@ func (s *SignalWorkflowTestSuite) TestSignalExternalWorkflowCommand_UnKnownTarge poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -1072,7 +1072,7 @@ func (s *SignalWorkflowTestSuite) TestSignalExternalWorkflowCommand_UnKnownTarge var historyEvents []*historypb.HistoryEvent CheckHistoryLoopForCancelSent: for i := 1; i < 10; i++ { - historyEvents = s.GetHistory(s.Namespace(), &commonpb.WorkflowExecution{ + historyEvents = s.GetHistory(s.Namespace().String(), &commonpb.WorkflowExecution{ WorkflowId: id, RunId: we.RunId, }) @@ -1114,7 +1114,7 @@ func (s *SignalWorkflowTestSuite) TestSignalExternalWorkflowCommand_SignalSelf() request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -1155,7 +1155,7 @@ func (s *SignalWorkflowTestSuite) TestSignalExternalWorkflowCommand_SignalSelf() return []*commandpb.Command{{ CommandType: enumspb.COMMAND_TYPE_SIGNAL_EXTERNAL_WORKFLOW_EXECUTION, Attributes: &commandpb.Command_SignalExternalWorkflowExecutionCommandAttributes{SignalExternalWorkflowExecutionCommandAttributes: &commandpb.SignalExternalWorkflowExecutionCommandAttributes{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: &commonpb.WorkflowExecution{ WorkflowId: id, RunId: we.GetRunId(), @@ -1172,7 +1172,7 @@ func (s *SignalWorkflowTestSuite) TestSignalExternalWorkflowCommand_SignalSelf() poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -1194,7 +1194,7 @@ func (s *SignalWorkflowTestSuite) TestSignalExternalWorkflowCommand_SignalSelf() var historyEvents []*historypb.HistoryEvent CheckHistoryLoopForCancelSent: for i := 1; i < 10; i++ { - historyEvents = s.GetHistory(s.Namespace(), &commonpb.WorkflowExecution{ + historyEvents = s.GetHistory(s.Namespace().String(), &commonpb.WorkflowExecution{ WorkflowId: id, RunId: we.RunId, }) @@ -1241,7 +1241,7 @@ func (s *SignalWorkflowTestSuite) TestSignalWithStartWorkflow() { // Start a workflow request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -1323,7 +1323,7 @@ func (s *SignalWorkflowTestSuite) TestSignalWithStartWorkflow() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -1343,7 +1343,7 @@ func (s *SignalWorkflowTestSuite) TestSignalWithStartWorkflow() { wfIDReusePolicy := enumspb.WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE sRequest := &workflowservice.SignalWithStartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -1374,7 +1374,7 @@ func (s *SignalWorkflowTestSuite) TestSignalWithStartWorkflow() { // Terminate workflow execution _, err = s.FrontendClient().TerminateWorkflowExecution(testcore.NewContext(), &workflowservice.TerminateWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: &commonpb.WorkflowExecution{ WorkflowId: id, }, @@ -1436,7 +1436,7 @@ func (s *SignalWorkflowTestSuite) TestSignalWithStartWorkflow() { s.Equal(identity, signalEvent.GetWorkflowExecutionSignaledEventAttributes().Identity) listOpenRequest := &workflowservice.ListOpenWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), MaximumPageSize: 100, StartTimeFilter: &filterpb.StartTimeFilter{ EarliestTime: nil, @@ -1462,7 +1462,7 @@ func (s *SignalWorkflowTestSuite) TestSignalWithStartWorkflow() { // Terminate workflow execution and assert visibility is correct _, err = s.FrontendClient().TerminateWorkflowExecution(testcore.NewContext(), &workflowservice.TerminateWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: &commonpb.WorkflowExecution{ WorkflowId: id, }, @@ -1483,7 +1483,7 @@ func (s *SignalWorkflowTestSuite) TestSignalWithStartWorkflow() { ) listClosedRequest := &workflowservice.ListClosedWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), MaximumPageSize: 100, StartTimeFilter: &filterpb.StartTimeFilter{ EarliestTime: nil, @@ -1516,7 +1516,7 @@ func (s *SignalWorkflowTestSuite) TestSignalWithStartWorkflow_ResolveIDDeduplica // Start a workflow request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -1570,7 +1570,7 @@ func (s *SignalWorkflowTestSuite) TestSignalWithStartWorkflow_ResolveIDDeduplica poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -1593,7 +1593,7 @@ func (s *SignalWorkflowTestSuite) TestSignalWithStartWorkflow_ResolveIDDeduplica signalInput := payloads.EncodeString("my signal input") sRequest := &workflowservice.SignalWithStartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -1631,7 +1631,7 @@ func (s *SignalWorkflowTestSuite) TestSignalWithStartWorkflow_ResolveIDDeduplica // Terminate workflow execution _, err = s.FrontendClient().TerminateWorkflowExecution(testcore.NewContext(), &workflowservice.TerminateWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: &commonpb.WorkflowExecution{ WorkflowId: id, }, @@ -1658,7 +1658,7 @@ func (s *SignalWorkflowTestSuite) TestSignalWithStartWorkflow_ResolveIDDeduplica s.True(resp.Started) descResp, err := s.FrontendClient().DescribeWorkflowExecution(testcore.NewContext(), &workflowservice.DescribeWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: &commonpb.WorkflowExecution{WorkflowId: id, RunId: prevRunID}, }) s.NoError(err) @@ -1675,14 +1675,14 @@ func (s *SignalWorkflowTestSuite) TestSignalWithStartWorkflow_ResolveIDDeduplica s.True(resp.Started) descResp, err = s.FrontendClient().DescribeWorkflowExecution(testcore.NewContext(), &workflowservice.DescribeWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: &commonpb.WorkflowExecution{WorkflowId: id, RunId: prevRunID}, }) s.NoError(err) s.Equal(enumspb.WORKFLOW_EXECUTION_STATUS_TERMINATED, descResp.WorkflowExecutionInfo.Status) descResp, err = s.FrontendClient().DescribeWorkflowExecution(testcore.NewContext(), &workflowservice.DescribeWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: &commonpb.WorkflowExecution{ WorkflowId: id, RunId: resp.GetRunId(), @@ -1706,7 +1706,7 @@ func (s *SignalWorkflowTestSuite) TestSignalWithStartWorkflow_StartDelay() { sRequest := &workflowservice.SignalWithStartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: &commonpb.WorkflowType{Name: wt}, TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, @@ -1746,7 +1746,7 @@ func (s *SignalWorkflowTestSuite) TestSignalWithStartWorkflow_StartDelay() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, StickyTaskQueue: &taskqueuepb.TaskQueue{Name: stickyTq, Kind: enumspb.TASK_QUEUE_KIND_STICKY, NormalName: tl}, Identity: identity, @@ -1764,7 +1764,7 @@ func (s *SignalWorkflowTestSuite) TestSignalWithStartWorkflow_StartDelay() { s.Equal(identity, signalEvent.GetWorkflowExecutionSignaledEventAttributes().Identity) descResp, descErr := s.FrontendClient().DescribeWorkflowExecution(testcore.NewContext(), &workflowservice.DescribeWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: &commonpb.WorkflowExecution{ WorkflowId: id, RunId: we0.RunId, diff --git a/tests/sizelimit_test.go b/tests/sizelimit_test.go index 7897dca1630..80a838aaa91 100644 --- a/tests/sizelimit_test.go +++ b/tests/sizelimit_test.go @@ -95,7 +95,7 @@ func (s *SizeLimitFunctionalSuite) TestTerminateWorkflowCausedByHistoryCountLimi request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -148,7 +148,7 @@ func (s *SizeLimitFunctionalSuite) TestTerminateWorkflowCausedByHistoryCountLimi poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -159,7 +159,7 @@ func (s *SizeLimitFunctionalSuite) TestTerminateWorkflowCausedByHistoryCountLimi for i := int32(0); i < activityCount-1; i++ { dwResp, err := s.FrontendClient().DescribeWorkflowExecution(testcore.NewContext(), &workflowservice.DescribeWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: &commonpb.WorkflowExecution{ WorkflowId: id, RunId: we.RunId, @@ -187,7 +187,7 @@ SignalLoop: signalName := "another signal" signalInput := payloads.EncodeString("another signal input") _, signalErr = s.FrontendClient().SignalWorkflowExecution(testcore.NewContext(), &workflowservice.SignalWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: &commonpb.WorkflowExecution{ WorkflowId: id, }, @@ -205,7 +205,7 @@ SignalLoop: s.EqualError(signalErr, common.FailureReasonHistoryCountExceedsLimit) s.IsType(&serviceerror.InvalidArgument{}, signalErr) - historyEvents := s.GetHistory(s.Namespace(), &commonpb.WorkflowExecution{ + historyEvents := s.GetHistory(s.Namespace().String(), &commonpb.WorkflowExecution{ WorkflowId: id, RunId: we.GetRunId(), }) @@ -239,7 +239,7 @@ SignalLoop: resp, err1 := s.FrontendClient().ListClosedWorkflowExecutions( testcore.NewContext(), &workflowservice.ListClosedWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), MaximumPageSize: 100, StartTimeFilter: &filterpb.StartTimeFilter{ EarliestTime: nil, @@ -299,7 +299,7 @@ func (s *SizeLimitFunctionalSuite) TestWorkflowFailed_PayloadSizeTooLarge() { } poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -310,7 +310,7 @@ func (s *SizeLimitFunctionalSuite) TestWorkflowFailed_PayloadSizeTooLarge() { request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: &commonpb.WorkflowType{Name: wt}, TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, @@ -332,7 +332,7 @@ func (s *SizeLimitFunctionalSuite) TestWorkflowFailed_PayloadSizeTooLarge() { } _, err = s.FrontendClient().SignalWorkflowExecution(testcore.NewContext(), &workflowservice.SignalWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: &commonpb.WorkflowExecution{WorkflowId: id, RunId: we.GetRunId()}, SignalName: "signal-name", Identity: identity, @@ -344,7 +344,7 @@ func (s *SizeLimitFunctionalSuite) TestWorkflowFailed_PayloadSizeTooLarge() { // Wait for workflow to fail. var historyEvents []*historypb.HistoryEvent for i := 0; i < 10; i++ { - historyEvents = s.GetHistory(s.Namespace(), &commonpb.WorkflowExecution{WorkflowId: id, RunId: we.GetRunId()}) + historyEvents = s.GetHistory(s.Namespace().String(), &commonpb.WorkflowExecution{WorkflowId: id, RunId: we.GetRunId()}) lastEvent := historyEvents[len(historyEvents)-1] if lastEvent.GetEventType() == enumspb.EVENT_TYPE_WORKFLOW_EXECUTION_FAILED { break @@ -373,7 +373,7 @@ func (s *SizeLimitFunctionalSuite) TestTerminateWorkflowCausedByMsSizeLimit() { request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -427,7 +427,7 @@ func (s *SizeLimitFunctionalSuite) TestTerminateWorkflowCausedByMsSizeLimit() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -437,7 +437,7 @@ func (s *SizeLimitFunctionalSuite) TestTerminateWorkflowCausedByMsSizeLimit() { } dwResp, err := s.FrontendClient().DescribeWorkflowExecution(testcore.NewContext(), &workflowservice.DescribeWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: &commonpb.WorkflowExecution{ WorkflowId: id, RunId: we.RunId, @@ -456,7 +456,7 @@ func (s *SizeLimitFunctionalSuite) TestTerminateWorkflowCausedByMsSizeLimit() { // Send another signal without RunID _, signalErr := s.FrontendClient().SignalWorkflowExecution(testcore.NewContext(), &workflowservice.SignalWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: &commonpb.WorkflowExecution{ WorkflowId: id, }, @@ -468,7 +468,7 @@ func (s *SizeLimitFunctionalSuite) TestTerminateWorkflowCausedByMsSizeLimit() { s.EqualError(signalErr, consts.ErrWorkflowCompleted.Error()) s.IsType(&serviceerror.NotFound{}, signalErr) - historyEvents := s.GetHistory(s.Namespace(), &commonpb.WorkflowExecution{ + historyEvents := s.GetHistory(s.Namespace().String(), &commonpb.WorkflowExecution{ WorkflowId: id, RunId: we.GetRunId(), }) @@ -485,7 +485,7 @@ func (s *SizeLimitFunctionalSuite) TestTerminateWorkflowCausedByMsSizeLimit() { resp, err1 := s.FrontendClient().ListClosedWorkflowExecutions( testcore.NewContext(), &workflowservice.ListClosedWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), MaximumPageSize: 100, StartTimeFilter: &filterpb.StartTimeFilter{ EarliestTime: nil, @@ -519,7 +519,7 @@ func (s *SizeLimitFunctionalSuite) TestTerminateWorkflowCausedByHistorySizeLimit taskQueue := &taskqueuepb.TaskQueue{Name: tq, Kind: enumspb.TASK_QUEUE_KIND_NORMAL} request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -544,7 +544,7 @@ SignalLoop: signalInput, err := payloads.Encode(largePayload) s.NoError(err) _, signalErr = s.FrontendClient().SignalWorkflowExecution(testcore.NewContext(), &workflowservice.SignalWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: &commonpb.WorkflowExecution{ WorkflowId: id, }, @@ -562,7 +562,7 @@ SignalLoop: s.EqualError(signalErr, common.FailureReasonHistorySizeExceedsLimit) s.IsType(&serviceerror.InvalidArgument{}, signalErr) - historyEvents := s.GetHistory(s.Namespace(), &commonpb.WorkflowExecution{ + historyEvents := s.GetHistory(s.Namespace().String(), &commonpb.WorkflowExecution{ WorkflowId: id, RunId: we.GetRunId(), }) @@ -586,7 +586,7 @@ SignalLoop: resp, err1 := s.FrontendClient().ListClosedWorkflowExecutions( testcore.NewContext(), &workflowservice.ListClosedWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), MaximumPageSize: 100, StartTimeFilter: &filterpb.StartTimeFilter{ EarliestTime: nil, diff --git a/tests/stickytq_test.go b/tests/stickytq_test.go index 0017ad7a5a9..3a267655a73 100644 --- a/tests/stickytq_test.go +++ b/tests/stickytq_test.go @@ -64,7 +64,7 @@ func (s *StickyTqTestSuite) TestStickyTimeout_NonTransientWorkflowTask() { // Start workflow execution request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: &commonpb.WorkflowType{Name: wt}, TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, @@ -130,7 +130,7 @@ func (s *StickyTqTestSuite) TestStickyTimeout_NonTransientWorkflowTask() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -145,7 +145,7 @@ func (s *StickyTqTestSuite) TestStickyTimeout_NonTransientWorkflowTask() { s.NoError(err) _, err = s.FrontendClient().SignalWorkflowExecution(testcore.NewContext(), &workflowservice.SignalWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: workflowExecution, SignalName: "signalA", Input: payloads.EncodeString("signal input"), @@ -158,7 +158,7 @@ func (s *StickyTqTestSuite) TestStickyTimeout_NonTransientWorkflowTask() { stickyTimeout := false WaitForStickyTimeoutLoop: for i := 0; i < 10; i++ { - events := s.GetHistory(s.Namespace(), workflowExecution) + events := s.GetHistory(s.Namespace().String(), workflowExecution) for _, event := range events { if event.GetEventType() == enumspb.EVENT_TYPE_WORKFLOW_TASK_TIMED_OUT { s.EqualHistoryEvents(` @@ -186,7 +186,7 @@ WaitForStickyTimeoutLoop: } _, err = s.FrontendClient().SignalWorkflowExecution(testcore.NewContext(), &workflowservice.SignalWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: workflowExecution, SignalName: "signalB", Input: payloads.EncodeString("signal input"), @@ -201,7 +201,7 @@ WaitForStickyTimeoutLoop: s.NoError(err) } - events := s.GetHistory(s.Namespace(), workflowExecution) + events := s.GetHistory(s.Namespace().String(), workflowExecution) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted 2 WorkflowTaskScheduled @@ -223,7 +223,7 @@ WaitForStickyTimeoutLoop: _, err = poller.PollAndProcessWorkflowTask(testcore.WithDumpHistory, testcore.WithRespondSticky, testcore.WithExpectedAttemptCount(3)) s.NoError(err) - events = s.GetHistory(s.Namespace(), workflowExecution) + events = s.GetHistory(s.Namespace().String(), workflowExecution) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted 2 WorkflowTaskScheduled @@ -259,7 +259,7 @@ func (s *StickyTqTestSuite) TestStickyTaskqueueResetThenTimeout() { // Start workflow execution request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: &commonpb.WorkflowType{Name: wt}, TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, @@ -311,7 +311,7 @@ func (s *StickyTqTestSuite) TestStickyTaskqueueResetThenTimeout() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -326,7 +326,7 @@ func (s *StickyTqTestSuite) TestStickyTaskqueueResetThenTimeout() { s.NoError(err) _, err = s.FrontendClient().SignalWorkflowExecution(testcore.NewContext(), &workflowservice.SignalWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: workflowExecution, SignalName: "signalA", Input: payloads.EncodeString("signal input"), @@ -337,7 +337,7 @@ func (s *StickyTqTestSuite) TestStickyTaskqueueResetThenTimeout() { // Reset sticky taskqueue before sticky workflow task starts _, err = s.FrontendClient().ResetStickyTaskQueue(testcore.NewContext(), &workflowservice.ResetStickyTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: workflowExecution, }) s.NoError(err) @@ -346,7 +346,7 @@ func (s *StickyTqTestSuite) TestStickyTaskqueueResetThenTimeout() { stickyTimeout := false WaitForStickyTimeoutLoop: for i := 0; i < 10; i++ { - events := s.GetHistory(s.Namespace(), workflowExecution) + events := s.GetHistory(s.Namespace().String(), workflowExecution) for _, event := range events { if event.GetEventType() == enumspb.EVENT_TYPE_WORKFLOW_TASK_TIMED_OUT { s.EqualHistoryEvents(` @@ -374,7 +374,7 @@ WaitForStickyTimeoutLoop: } _, err = s.FrontendClient().SignalWorkflowExecution(testcore.NewContext(), &workflowservice.SignalWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: workflowExecution, SignalName: "signalB", Input: payloads.EncodeString("signal input"), @@ -389,7 +389,7 @@ WaitForStickyTimeoutLoop: s.NoError(err) } - events := s.GetHistory(s.Namespace(), workflowExecution) + events := s.GetHistory(s.Namespace().String(), workflowExecution) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted 2 WorkflowTaskScheduled @@ -411,7 +411,7 @@ WaitForStickyTimeoutLoop: _, err = poller.PollAndProcessWorkflowTask(testcore.WithDumpHistory, testcore.WithRespondSticky, testcore.WithExpectedAttemptCount(3)) s.NoError(err) - events = s.GetHistory(s.Namespace(), workflowExecution) + events = s.GetHistory(s.Namespace().String(), workflowExecution) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted 2 WorkflowTaskScheduled diff --git a/tests/testcore/client_suite.go b/tests/testcore/client_suite.go index 66c0b74b5e1..648e58000ef 100644 --- a/tests/testcore/client_suite.go +++ b/tests/testcore/client_suite.go @@ -111,7 +111,7 @@ func (s *ClientFunctionalSuite) SetupTest() { sdkClient, err := sdkclient.Dial(sdkclient.Options{ HostPort: s.FrontendGRPCAddress(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), }) if err != nil { s.Logger.Fatal("Error when creating SDK client", tag.Error(err)) diff --git a/tests/testcore/functional.go b/tests/testcore/functional.go index 65a9eac9d50..368c548807c 100644 --- a/tests/testcore/functional.go +++ b/tests/testcore/functional.go @@ -72,7 +72,7 @@ func (s *FunctionalSuite) SetupTest() { s.ProtoAssertions = protorequire.New(s.T()) s.HistoryRequire = historyrequire.New(s.T()) s.UpdateUtils = updateutils.New(s.T()) - s.TaskPoller = taskpoller.New(s.T(), s.client, s.namespace) + s.TaskPoller = taskpoller.New(s.T(), s.client, s.Namespace().String()) } func (s *FunctionalSuite) SendSignal(namespace string, execution *commonpb.WorkflowExecution, signalName string, diff --git a/tests/testcore/functional_test_base.go b/tests/testcore/functional_test_base.go index 3a3256dac9e..d104b5d127d 100644 --- a/tests/testcore/functional_test_base.go +++ b/tests/testcore/functional_test_base.go @@ -50,6 +50,7 @@ import ( "go.temporal.io/server/common/dynamicconfig" "go.temporal.io/server/common/log" "go.temporal.io/server/common/log/tag" + "go.temporal.io/server/common/namespace" "go.temporal.io/server/common/payloads" "go.temporal.io/server/common/persistence" "go.temporal.io/server/common/primitives" @@ -57,7 +58,6 @@ import ( "go.temporal.io/server/common/rpc" "go.temporal.io/server/environment" "go.uber.org/fx" - "google.golang.org/protobuf/types/known/durationpb" "gopkg.in/yaml.v3" ) @@ -74,9 +74,11 @@ type ( operatorClient operatorservice.OperatorServiceClient httpAPIAddress string Logger log.Logger - namespace string - foreignNamespace string - archivalNamespace string + namespace namespace.Name + namespaceID namespace.ID + foreignNamespace namespace.Name + archivalNamespace namespace.Name + archivalNamespaceID namespace.ID dynamicConfigOverrides map[dynamicconfig.Key]interface{} } // TestClusterParams contains the variables which are used to configure test suites via the Option type. @@ -127,15 +129,23 @@ func (s *FunctionalTestBase) HttpAPIAddress() string { return s.httpAPIAddress } -func (s *FunctionalTestBase) Namespace() string { +func (s *FunctionalTestBase) Namespace() namespace.Name { return s.namespace } -func (s *FunctionalTestBase) ArchivalNamespace() string { +func (s *FunctionalTestBase) NamespaceID() namespace.ID { + return s.namespaceID +} + +func (s *FunctionalTestBase) ArchivalNamespace() namespace.Name { return s.archivalNamespace } -func (s *FunctionalTestBase) ForeignNamespace() string { +func (s *FunctionalTestBase) ArchivalNamespaceID() namespace.ID { + return s.archivalNamespaceID +} + +func (s *FunctionalTestBase) ForeignNamespace() namespace.Name { return s.foreignNamespace } @@ -183,15 +193,24 @@ func (s *FunctionalTestBase) SetupSuite(defaultClusterConfigFile string, options s.operatorClient = s.testCluster.OperatorClient() s.httpAPIAddress = cluster.Host().FrontendHTTPAddress() - s.namespace = RandomizeStr("namespace") - s.Require().NoError(s.registerNamespaceWithDefaults(s.namespace)) + s.namespace = namespace.Name(RandomizeStr("namespace")) + s.namespaceID, err = s.registerNamespace(s.Namespace(), 1, enumspb.ARCHIVAL_STATE_DISABLED, "", "") + s.Require().NoError(err) - s.foreignNamespace = RandomizeStr("foreign-namespace") - s.Require().NoError(s.registerNamespaceWithDefaults(s.foreignNamespace)) + s.foreignNamespace = namespace.Name(RandomizeStr("foreign-namespace")) + _, err = s.registerNamespace(s.ForeignNamespace(), 1, enumspb.ARCHIVAL_STATE_DISABLED, "", "") + s.Require().NoError(err) if clusterConfig.EnableArchival { - s.archivalNamespace = RandomizeStr("archival-enabled-namespace") - s.Require().NoError(s.registerArchivalNamespace(s.archivalNamespace)) + s.archivalNamespace = namespace.Name(RandomizeStr("archival-enabled-namespace")) + s.archivalNamespaceID, err = s.registerNamespace( + s.ArchivalNamespace(), + 0, // Archive right away. + enumspb.ARCHIVAL_STATE_ENABLED, + s.testCluster.archiverBase.historyURI, + s.testCluster.archiverBase.visibilityURI, + ) + s.Require().NoError(err) } } @@ -234,10 +253,6 @@ func (s *FunctionalTestBase) checkTestShard() { s.T().Logf("Running %s in test shard %d/%d", s.T().Name(), index+1, total) } -func (s *FunctionalTestBase) registerNamespaceWithDefaults(name string) error { - return s.registerNamespace(name, 24*time.Hour, enumspb.ARCHIVAL_STATE_DISABLED, "", enumspb.ARCHIVAL_STATE_DISABLED, "") -} - func ApplyTestClusterParams(options []Option) TestClusterParams { params := TestClusterParams{ ServiceOptions: make(map[primitives.ServiceName][]fx.Option), @@ -302,10 +317,10 @@ func GetTestClusterConfig(configFile string) (*TestClusterConfig, error) { } func (s *FunctionalTestBase) TearDownSuite() { - s.Require().NoError(s.markNamespaceAsDeleted(s.namespace)) - s.Require().NoError(s.markNamespaceAsDeleted(s.foreignNamespace)) - if s.archivalNamespace != "" { - s.Require().NoError(s.markNamespaceAsDeleted(s.archivalNamespace)) + s.Require().NoError(s.markNamespaceAsDeleted(s.Namespace())) + s.Require().NoError(s.markNamespaceAsDeleted(s.ForeignNamespace())) + if s.ArchivalNamespace() != namespace.EmptyName { + s.Require().NoError(s.markNamespaceAsDeleted(s.ArchivalNamespace())) } if s.testCluster != nil { @@ -317,55 +332,74 @@ func (s *FunctionalTestBase) TearDownSuite() { s.adminClient = nil } +// Register namespace using persistence API because: +// 1. The Retention period is set to 0 for archival tests, and this can't be done through FE, +// 2. Update search attributes would require an extra API call, +// 3. One more extra API call would be necessary to get namespace.ID. func (s *FunctionalTestBase) registerNamespace( - namespace string, - retention time.Duration, - historyArchivalState enumspb.ArchivalState, + nsName namespace.Name, + retentionDays int32, + archivalState enumspb.ArchivalState, historyArchivalURI string, - visibilityArchivalState enumspb.ArchivalState, visibilityArchivalURI string, -) error { - ctx, cancel := rpc.NewContextWithTimeoutAndVersionHeaders(10000 * time.Second) - defer cancel() - _, err := s.client.RegisterNamespace(ctx, &workflowservice.RegisterNamespaceRequest{ - Namespace: namespace, - Description: namespace, - WorkflowExecutionRetentionPeriod: durationpb.New(retention), - HistoryArchivalState: historyArchivalState, - HistoryArchivalUri: historyArchivalURI, - VisibilityArchivalState: visibilityArchivalState, - VisibilityArchivalUri: visibilityArchivalURI, - }) +) (namespace.ID, error) { + currentClusterName := s.testCluster.testBase.ClusterMetadata.GetCurrentClusterName() + nsID := namespace.ID(uuid.New()) + namespaceRequest := &persistence.CreateNamespaceRequest{ + Namespace: &persistencespb.NamespaceDetail{ + Info: &persistencespb.NamespaceInfo{ + Id: nsID.String(), + Name: nsName.String(), + State: enumspb.NAMESPACE_STATE_REGISTERED, + Description: "namespace for functional tests", + }, + Config: &persistencespb.NamespaceConfig{ + Retention: timestamp.DurationFromDays(retentionDays), + HistoryArchivalState: archivalState, + HistoryArchivalUri: historyArchivalURI, + VisibilityArchivalState: archivalState, + VisibilityArchivalUri: visibilityArchivalURI, + BadBinaries: &namespacepb.BadBinaries{Binaries: map[string]*namespacepb.BadBinaryInfo{}}, + CustomSearchAttributeAliases: map[string]string{ + "Bool01": "CustomBoolField", + "Datetime01": "CustomDatetimeField", + "Double01": "CustomDoubleField", + "Int01": "CustomIntField", + "Keyword01": "CustomKeywordField", + "Text01": "CustomTextField", + }, + }, + ReplicationConfig: &persistencespb.NamespaceReplicationConfig{ + ActiveClusterName: currentClusterName, + Clusters: []string{ + currentClusterName, + }, + }, - if err != nil { - return err + FailoverVersion: common.EmptyVersion, + }, + IsGlobalNamespace: false, } + _, err := s.testCluster.testBase.MetadataManager.CreateNamespace(context.Background(), namespaceRequest) - // Set up default alias for custom search attributes. - _, err = s.client.UpdateNamespace(ctx, &workflowservice.UpdateNamespaceRequest{ - Namespace: namespace, - Config: &namespacepb.NamespaceConfig{ - CustomSearchAttributeAliases: map[string]string{ - "Bool01": "CustomBoolField", - "Datetime01": "CustomDatetimeField", - "Double01": "CustomDoubleField", - "Int01": "CustomIntField", - "Keyword01": "CustomKeywordField", - "Text01": "CustomTextField", - }, - }, - }) + if err != nil { + return namespace.EmptyID, err + } - return err + s.Logger.Info("Register namespace succeeded", + tag.WorkflowNamespace(nsName.String()), + tag.WorkflowNamespaceID(nsID.String()), + ) + return nsID, nil } func (s *FunctionalTestBase) markNamespaceAsDeleted( - namespace string, + nsName namespace.Name, ) error { ctx, cancel := rpc.NewContextWithTimeoutAndVersionHeaders(10000 * time.Second) defer cancel() _, err := s.client.UpdateNamespace(ctx, &workflowservice.UpdateNamespaceRequest{ - Namespace: namespace, + Namespace: nsName.String(), UpdateInfo: &namespacepb.UpdateNamespaceInfo{ State: enumspb.NAMESPACE_STATE_DELETED, }, @@ -430,46 +464,6 @@ func (s *FunctionalTestBase) DurationNear(value, target, tolerance time.Duration s.Less(value, target+tolerance) } -// To register archival namespace we can't use frontend API as the retention period is set to 0 for testing, -// and request will be rejected by frontend. Here we make a call directly to persistence to register -// the namespace. -func (s *FunctionalTestBase) registerArchivalNamespace(archivalNamespace string) error { - currentClusterName := s.testCluster.testBase.ClusterMetadata.GetCurrentClusterName() - namespaceRequest := &persistence.CreateNamespaceRequest{ - Namespace: &persistencespb.NamespaceDetail{ - Info: &persistencespb.NamespaceInfo{ - Id: uuid.New(), - Name: archivalNamespace, - State: enumspb.NAMESPACE_STATE_REGISTERED, - }, - Config: &persistencespb.NamespaceConfig{ - Retention: timestamp.DurationFromDays(0), - HistoryArchivalState: enumspb.ARCHIVAL_STATE_ENABLED, - HistoryArchivalUri: s.testCluster.archiverBase.historyURI, - VisibilityArchivalState: enumspb.ARCHIVAL_STATE_ENABLED, - VisibilityArchivalUri: s.testCluster.archiverBase.visibilityURI, - BadBinaries: &namespacepb.BadBinaries{Binaries: map[string]*namespacepb.BadBinaryInfo{}}, - }, - ReplicationConfig: &persistencespb.NamespaceReplicationConfig{ - ActiveClusterName: currentClusterName, - Clusters: []string{ - currentClusterName, - }, - }, - - FailoverVersion: common.EmptyVersion, - }, - IsGlobalNamespace: false, - } - response, err := s.testCluster.testBase.MetadataManager.CreateNamespace(context.Background(), namespaceRequest) - - s.Logger.Info("Register namespace succeeded", - tag.WorkflowNamespace(archivalNamespace), - tag.WorkflowNamespaceID(response.ID), - ) - return err -} - // Overrides one dynamic config setting for the duration of this test (or sub-test). The change // will automatically be reverted at the end of the test (using t.Cleanup). The cleanup // function is also returned if you want to revert the change before the end of the test. diff --git a/tests/tls_test.go b/tests/tls_test.go index 8f4ce47f5fc..bc4e92e3ca4 100644 --- a/tests/tls_test.go +++ b/tests/tls_test.go @@ -64,7 +64,7 @@ func (s *TLSFunctionalSuite) SetupTest() { var err error s.sdkClient, err = sdkclient.Dial(sdkclient.Options{ HostPort: s.FrontendGRPCAddress(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), ConnectionOptions: sdkclient.ConnectionOptions{ TLS: s.GetTestCluster().Host().TlsConfigProvider().FrontendClientConfig, }, @@ -104,7 +104,7 @@ func (s *TLSFunctionalSuite) TestHTTPMTLS() { calls := s.trackAuthInfoByCall() // Confirm non-HTTPS call is rejected with 400 - resp, err := http.Get("http://" + s.HttpAPIAddress() + "/namespaces/" + s.Namespace() + "/workflows") + resp, err := http.Get("http://" + s.HttpAPIAddress() + "/namespaces/" + s.Namespace().String() + "/workflows") s.Require().NoError(err) s.Require().Equal(http.StatusBadRequest, resp.StatusCode) @@ -116,7 +116,7 @@ func (s *TLSFunctionalSuite) TestHTTPMTLS() { } // Make a list call - req, err := http.NewRequest("GET", "https://"+s.HttpAPIAddress()+"/namespaces/"+s.Namespace()+"/workflows", nil) + req, err := http.NewRequest("GET", "https://"+s.HttpAPIAddress()+"/namespaces/"+s.Namespace().String()+"/workflows", nil) s.Require().NoError(err) resp, err = httpClient.Do(req) s.Require().NoError(err) diff --git a/tests/transient_task_test.go b/tests/transient_task_test.go index 486f11cda27..343d07f88cc 100644 --- a/tests/transient_task_test.go +++ b/tests/transient_task_test.go @@ -63,7 +63,7 @@ func (s *TransientTaskSuite) TestTransientWorkflowTaskTimeout() { // Start workflow execution request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: &commonpb.WorkflowType{Name: wt}, TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, @@ -111,7 +111,7 @@ func (s *TransientTaskSuite) TestTransientWorkflowTaskTimeout() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -126,7 +126,7 @@ func (s *TransientTaskSuite) TestTransientWorkflowTaskTimeout() { s.NoError(err) // Now send a signal when transient workflow task is scheduled - err = s.SendSignal(s.Namespace(), workflowExecution, "signalA", nil, identity) + err = s.SendSignal(s.Namespace().String(), workflowExecution, "signalA", nil, identity) s.NoError(err, "failed to send signal to execution") // Drop workflow task to cause a workflow task timeout @@ -152,7 +152,7 @@ func (s *TransientTaskSuite) TestTransientWorkflowTaskHistorySize() { // Start workflow execution request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: &commonpb.WorkflowType{Name: wt}, TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, @@ -258,7 +258,7 @@ func (s *TransientTaskSuite) TestTransientWorkflowTaskHistorySize() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -272,7 +272,7 @@ func (s *TransientTaskSuite) TestTransientWorkflowTaskHistorySize() { s.Logger.Info("PollAndProcessWorkflowTask", tag.Error(err)) s.NoError(err) - err = s.SendSignal(s.Namespace(), workflowExecution, "signal", nil, identity) + err = s.SendSignal(s.Namespace().String(), workflowExecution, "signal", nil, identity) s.NoError(err, "failed to send signal to execution") // stage 2 @@ -280,7 +280,7 @@ func (s *TransientTaskSuite) TestTransientWorkflowTaskHistorySize() { s.Logger.Info("PollAndProcessWorkflowTask", tag.Error(err)) s.NoError(err) - err = s.SendSignal(s.Namespace(), workflowExecution, "signal", nil, identity) + err = s.SendSignal(s.Namespace().String(), workflowExecution, "signal", nil, identity) s.NoError(err, "failed to send signal to execution") // stage 3: this one fails with a panic @@ -297,7 +297,7 @@ func (s *TransientTaskSuite) TestTransientWorkflowTaskHistorySize() { s.Logger.Info("PollAndProcessWorkflowTask", tag.Error(err)) s.NoError(err) - err = s.SendSignal(s.Namespace(), workflowExecution, "signal", nil, identity) + err = s.SendSignal(s.Namespace().String(), workflowExecution, "signal", nil, identity) s.NoError(err, "failed to send signal to execution") // drop workflow task to cause a workflow task timeout @@ -317,7 +317,7 @@ func (s *TransientTaskSuite) TestTransientWorkflowTaskHistorySize() { sawFieldsFlat = append(sawFieldsFlat, f.size, f.suggest) } - allEvents := s.GetHistory(s.Namespace(), workflowExecution) + allEvents := s.GetHistory(s.Namespace().String(), workflowExecution) s.EqualHistoryEvents(fmt.Sprintf(` 1 WorkflowExecutionStarted 2 WorkflowTaskScheduled @@ -355,7 +355,7 @@ func (s *TransientTaskSuite) TestNoTransientWorkflowTaskAfterFlushBufferedEvents // Start workflow execution request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: &commonpb.WorkflowType{Name: wt}, TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, @@ -379,7 +379,7 @@ func (s *TransientTaskSuite) TestNoTransientWorkflowTaskAfterFlushBufferedEvents // this will create new event when there is in-flight workflow task, and the new event will be buffered _, err := s.FrontendClient().SignalWorkflowExecution(testcore.NewContext(), &workflowservice.SignalWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: &commonpb.WorkflowExecution{ WorkflowId: id, }, @@ -412,7 +412,7 @@ func (s *TransientTaskSuite) TestNoTransientWorkflowTaskAfterFlushBufferedEvents poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, Identity: identity, WorkflowTaskHandler: wtHandler, diff --git a/tests/update_workflow_sdk_test.go b/tests/update_workflow_sdk_test.go index dc0e1042713..6fc76624692 100644 --- a/tests/update_workflow_sdk_test.go +++ b/tests/update_workflow_sdk_test.go @@ -61,7 +61,7 @@ func (s *UpdateWorkflowSdkSuite) TestUpdateWorkflow_TerminateWorkflowAfterUpdate defer cancel() tv := testvars.New(s.T()). WithTaskQueue(s.TaskQueue()). - WithNamespaceName(namespace.Name(s.Namespace())) + WithNamespaceName(s.Namespace()) workflowFn := func(ctx workflow.Context) error { s.NoError(workflow.SetUpdateHandler(ctx, tv.HandlerName(), func(ctx workflow.Context, arg string) error { @@ -84,7 +84,7 @@ func (s *UpdateWorkflowSdkSuite) TestUpdateWorkflow_TerminateWorkflowAfterUpdate var notFound *serviceerror.NotFound s.ErrorAs(err, ¬Found) - hist := s.GetHistory(s.Namespace(), tv.WorkflowExecution()) + hist := s.GetHistory(s.Namespace().String(), tv.WorkflowExecution()) s.EqualHistoryEventsPrefix(` 1 WorkflowExecutionStarted 2 WorkflowTaskScheduled`, hist) @@ -101,7 +101,7 @@ func (s *UpdateWorkflowSdkSuite) TestUpdateWorkflow_TimeoutWorkflowAfterUpdateAc defer cancel() tv := testvars.New(s.T()). WithTaskQueue(s.TaskQueue()). - WithNamespaceName(namespace.Name(s.Namespace())) + WithNamespaceName(s.Namespace()) workflowFn := func(ctx workflow.Context) error { s.NoError(workflow.SetUpdateHandler(ctx, tv.HandlerName(), func(ctx workflow.Context, arg string) error { @@ -154,7 +154,7 @@ func (s *UpdateWorkflowSdkSuite) TestUpdateWorkflow_TimeoutWorkflowAfterUpdateAc 6 WorkflowTaskStarted 7 WorkflowTaskCompleted 8 WorkflowExecutionUpdateAccepted - 9 WorkflowExecutionTimedOut`, s.GetHistory(s.Namespace(), tv.WorkflowExecution())) + 9 WorkflowExecutionTimedOut`, s.GetHistory(s.Namespace().String(), tv.WorkflowExecution())) } // TestUpdateWorkflow_TerminateWorkflowAfterUpdateAccepted executes an update, and while WF awaits @@ -165,7 +165,7 @@ func (s *UpdateWorkflowSdkSuite) TestUpdateWorkflow_TerminateWorkflowAfterUpdate defer cancel() tv := testvars.New(s.T()). WithTaskQueue(s.TaskQueue()). - WithNamespaceName(namespace.Name(s.Namespace())) + WithNamespaceName(namespace.Name(s.Namespace().String())) workflowFn := func(ctx workflow.Context) error { s.NoError(workflow.SetUpdateHandler(ctx, tv.HandlerName(), func(ctx workflow.Context, arg string) error { @@ -214,7 +214,7 @@ func (s *UpdateWorkflowSdkSuite) TestUpdateWorkflow_TerminateWorkflowAfterUpdate 6 WorkflowTaskStarted 7 WorkflowTaskCompleted 8 WorkflowExecutionUpdateAccepted - 9 WorkflowExecutionTerminated`, s.GetHistory(s.Namespace(), tv.WorkflowExecution())) + 9 WorkflowExecutionTerminated`, s.GetHistory(s.Namespace().String(), tv.WorkflowExecution())) } func (s *UpdateWorkflowSdkSuite) TestUpdateWorkflow_ContinueAsNewAfterUpdateAdmitted() { @@ -229,7 +229,7 @@ func (s *UpdateWorkflowSdkSuite) TestUpdateWorkflow_ContinueAsNewAfterUpdateAdmi tv := testvars.New(s.T()). WithTaskQueue(s.TaskQueue()). - WithNamespaceName(namespace.Name(s.Namespace())) + WithNamespaceName(namespace.Name(s.Namespace().String())) rootCtx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() @@ -287,9 +287,9 @@ func (s *UpdateWorkflowSdkSuite) TestUpdateWorkflow_ContinueAsNewAfterUpdateAdmi 3 WorkflowTaskStarted 4 WorkflowTaskCompleted 5 MarkerRecorded - 6 WorkflowExecutionContinuedAsNew`, s.GetHistory(s.Namespace(), tv.WithRunID(firstRun.GetRunID()).WorkflowExecution())) + 6 WorkflowExecutionContinuedAsNew`, s.GetHistory(s.Namespace().String(), tv.WithRunID(firstRun.GetRunID()).WorkflowExecution())) - hist2 := s.GetHistory(s.Namespace(), tv.WithRunID(secondRunID).WorkflowExecution()) + hist2 := s.GetHistory(s.Namespace().String(), tv.WithRunID(secondRunID).WorkflowExecution()) s.EqualHistoryEventsPrefix(` 1 WorkflowExecutionStarted 2 WorkflowTaskScheduled @@ -316,7 +316,7 @@ func (s *UpdateWorkflowSdkSuite) TestUpdateWorkflow_TimeoutWithRetryAfterUpdateA tv := testvars.New(s.T()). WithTaskQueue(s.TaskQueue()). - WithNamespaceName(namespace.Name(s.Namespace())) + WithNamespaceName(namespace.Name(s.Namespace().String())) ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() @@ -369,14 +369,14 @@ func (s *UpdateWorkflowSdkSuite) TestUpdateWorkflow_TimeoutWithRetryAfterUpdateA 2 WorkflowTaskScheduled 3 WorkflowTaskStarted 4 WorkflowTaskFailed - 5 WorkflowExecutionTimedOut`, s.GetHistory(s.Namespace(), tv.WithRunID(firstRun.GetRunID()).WorkflowExecution())) + 5 WorkflowExecutionTimedOut`, s.GetHistory(s.Namespace().String(), tv.WithRunID(firstRun.GetRunID()).WorkflowExecution())) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted 2 WorkflowTaskScheduled 3 WorkflowTaskStarted 4 WorkflowTaskCompleted 5 WorkflowExecutionUpdateAccepted - 6 WorkflowExecutionUpdateCompleted`, s.GetHistory(s.Namespace(), tv.WithRunID(secondRunID).WorkflowExecution())) + 6 WorkflowExecutionUpdateCompleted`, s.GetHistory(s.Namespace().String(), tv.WithRunID(secondRunID).WorkflowExecution())) } func (s *UpdateWorkflowSdkSuite) startWorkflow(ctx context.Context, tv *testvars.TestVars, workflowFn any) sdkclient.WorkflowRun { diff --git a/tests/update_workflow_suite_base.go b/tests/update_workflow_suite_base.go index 6975fc47ac1..c55cd7ace9e 100644 --- a/tests/update_workflow_suite_base.go +++ b/tests/update_workflow_suite_base.go @@ -95,7 +95,7 @@ func (s *WorkflowUpdateBaseSuite) updateWorkflowRequest( waitPolicy *updatepb.WaitPolicy, ) *workflowservice.UpdateWorkflowExecutionRequest { return &workflowservice.UpdateWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: tv.WorkflowExecution(), WaitPolicy: waitPolicy, Request: &updatepb.Request{ @@ -112,7 +112,7 @@ func (s *WorkflowUpdateBaseSuite) waitUpdateAdmitted(tv *testvars.TestVars) { s.T().Helper() s.EventuallyWithTf(func(collect *assert.CollectT) { pollResp, pollErr := s.FrontendClient().PollWorkflowExecutionUpdate(testcore.NewContext(), &workflowservice.PollWorkflowExecutionUpdateRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), UpdateRef: tv.UpdateRef(), WaitPolicy: &updatepb.WaitPolicy{LifecycleStage: enumspb.UPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_UNSPECIFIED}, }) @@ -133,7 +133,7 @@ func (s *WorkflowUpdateBaseSuite) startWorkflow(tv *testvars.TestVars) *testvars func (s *WorkflowUpdateBaseSuite) startWorkflowRequest(tv *testvars.TestVars) *workflowservice.StartWorkflowExecutionRequest { return &workflowservice.StartWorkflowExecutionRequest{ RequestId: tv.Any().String(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: tv.WorkflowID(), WorkflowType: tv.WorkflowType(), TaskQueue: tv.TaskQueue(), diff --git a/tests/update_workflow_test.go b/tests/update_workflow_test.go index 19ce8c1b77b..436f5f3f1df 100644 --- a/tests/update_workflow_test.go +++ b/tests/update_workflow_test.go @@ -85,7 +85,7 @@ func (s *UpdateWorkflowSuite) sendUpdateNoErrorWaitPolicyAccepted(tv *testvars.T func (s *UpdateWorkflowSuite) pollUpdate(tv *testvars.TestVars, waitPolicy *updatepb.WaitPolicy) (*workflowservice.PollWorkflowExecutionUpdateResponse, error) { s.T().Helper() return s.FrontendClient().PollWorkflowExecutionUpdate(testcore.NewContext(), &workflowservice.PollWorkflowExecutionUpdateRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), UpdateRef: &updatepb.UpdateRef{ WorkflowExecution: tv.WorkflowExecution(), UpdateId: tv.UpdateID(), @@ -195,7 +195,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_EmptySpeculativeWorkflowTask_Ac poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tv.TaskQueue(), WorkflowTaskHandler: wtHandler, MessageHandler: msgHandler, @@ -234,7 +234,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_EmptySpeculativeWorkflowTask_Ac s.Equal(1, commits) s.Equal(0, rollbacks) - events := s.GetHistory(s.Namespace(), tv.WorkflowExecution()) + events := s.GetHistory(s.Namespace().String(), tv.WorkflowExecution()) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted @@ -330,7 +330,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_NotEmptySpeculativeWorkflowTask poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tv.TaskQueue(), Identity: tv.WorkerIdentity(), WorkflowTaskHandler: wtHandler, @@ -356,7 +356,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_NotEmptySpeculativeWorkflowTask s.Equal(2, wtHandlerCalls) s.Equal(2, msgHandlerCalls) - events := s.GetHistory(s.Namespace(), tv.WorkflowExecution()) + events := s.GetHistory(s.Namespace().String(), tv.WorkflowExecution()) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted @@ -437,7 +437,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_FirstNormalScheduledWorkflowTas poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tv.TaskQueue(), Identity: tv.WorkerIdentity(), WorkflowTaskHandler: wtHandler, @@ -460,7 +460,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_FirstNormalScheduledWorkflowTas s.Equal(1, wtHandlerCalls) s.Equal(1, msgHandlerCalls) - events := s.GetHistory(s.Namespace(), tv.WorkflowExecution()) + events := s.GetHistory(s.Namespace().String(), tv.WorkflowExecution()) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted @@ -546,7 +546,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_NormalScheduledWorkflowTask_Acc poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tv.TaskQueue(), Identity: tv.WorkerIdentity(), WorkflowTaskHandler: wtHandler, @@ -560,7 +560,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_NormalScheduledWorkflowTask_Acc s.NoError(err) // Send signal to schedule new WT. - err = s.SendSignal(s.Namespace(), tv.WorkflowExecution(), tv.Any().String(), tv.Any().Payloads(), tv.Any().String()) + err = s.SendSignal(s.Namespace().String(), tv.WorkflowExecution(), tv.Any().String(), tv.Any().Payloads(), tv.Any().String()) s.NoError(err) updateResultCh := s.sendUpdateNoError(tv) @@ -577,7 +577,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_NormalScheduledWorkflowTask_Acc s.Equal(2, wtHandlerCalls) s.Equal(2, msgHandlerCalls) - events := s.GetHistory(s.Namespace(), tv.WorkflowExecution()) + events := s.GetHistory(s.Namespace().String(), tv.WorkflowExecution()) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted @@ -662,7 +662,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_RunningWorkflowTask_NewEmptySpe poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tv.TaskQueue(), Identity: tv.WorkerIdentity(), WorkflowTaskHandler: wtHandler, @@ -685,7 +685,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_RunningWorkflowTask_NewEmptySpe s.EqualValues(3, wt2Resp.ResetHistoryEventId) // Send signal to create WT. - err = s.SendSignal(s.Namespace(), tv.WorkflowExecution(), tv.Any().String(), tv.Any().Payloads(), tv.Any().String()) + err = s.SendSignal(s.Namespace().String(), tv.WorkflowExecution(), tv.Any().String(), tv.Any().Payloads(), tv.Any().String()) s.NoError(err) // Complete workflow. @@ -700,7 +700,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_RunningWorkflowTask_NewEmptySpe s.Equal(0, commits) s.Equal(1, rollbacks) - events := s.GetHistory(s.Namespace(), tv.WorkflowExecution()) + events := s.GetHistory(s.Namespace().String(), tv.WorkflowExecution()) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted @@ -799,7 +799,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_RunningWorkflowTask_NewNotEmpty poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tv.TaskQueue(), Identity: tv.WorkerIdentity(), WorkflowTaskHandler: wtHandler, @@ -835,7 +835,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_RunningWorkflowTask_NewNotEmpty s.Equal(3, wtHandlerCalls) s.Equal(3, msgHandlerCalls) - events := s.GetHistory(s.Namespace(), tv.WorkflowExecution()) + events := s.GetHistory(s.Namespace().String(), tv.WorkflowExecution()) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted @@ -895,7 +895,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_CompletedWorkflow() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tv.TaskQueue(), Identity: tv.WorkerIdentity(), WorkflowTaskHandler: wtHandler, @@ -965,7 +965,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_CompletedWorkflow() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tv.TaskQueue(), Identity: tv.WorkerIdentity(), WorkflowTaskHandler: wtHandler, @@ -1322,7 +1322,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_ValidateWorkerMessages() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tv.TaskQueue(), Identity: tv.WorkerIdentity(), WorkflowTaskHandler: wtHandler, @@ -1432,7 +1432,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_StickySpeculativeWorkflowTask_A 7 WorkflowTaskCompleted 8 WorkflowExecutionUpdateAccepted {"AcceptedRequestSequencingEventId": 5} // WTScheduled event which delivered update to the worker. 9 WorkflowExecutionUpdateCompleted {"AcceptedEventId": 8} - `, s.GetHistory(s.Namespace(), tv.WorkflowExecution())) + `, s.GetHistory(s.Namespace().String(), tv.WorkflowExecution())) }) } } @@ -1489,7 +1489,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_StickySpeculativeWorkflowTask_A poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tv.TaskQueue(), StickyTaskQueue: tv.StickyTaskQueue(), StickyScheduleToStartTimeout: 3 * time.Second, @@ -1524,7 +1524,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_StickySpeculativeWorkflowTask_A s.Equal(2, wtHandlerCalls) s.Equal(2, msgHandlerCalls) - events := s.GetHistory(s.Namespace(), tv.WorkflowExecution()) + events := s.GetHistory(s.Namespace().String(), tv.WorkflowExecution()) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted @@ -1581,7 +1581,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_FirstNormalScheduledWorkflowTas poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tv.TaskQueue(), Identity: tv.WorkerIdentity(), WorkflowTaskHandler: wtHandler, @@ -1603,7 +1603,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_FirstNormalScheduledWorkflowTas s.Equal(1, wtHandlerCalls) s.Equal(1, msgHandlerCalls) - events := s.GetHistory(s.Namespace(), tv.WorkflowExecution()) + events := s.GetHistory(s.Namespace().String(), tv.WorkflowExecution()) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted @@ -1652,7 +1652,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_EmptySpeculativeWorkflowTask_Re s.EqualValues(3, res.ResetHistoryEventId) // Send signal to create WT. - err = s.SendSignal(s.Namespace(), tv.WorkflowExecution(), tv.Any().String(), tv.Any().Payloads(), tv.Any().String()) + err = s.SendSignal(s.Namespace().String(), tv.WorkflowExecution(), tv.Any().String(), tv.Any().Payloads(), tv.Any().String()) s.NoError(err) // Process signal and complete workflow. @@ -1681,7 +1681,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_EmptySpeculativeWorkflowTask_Re s.NoError(err) s.NotNil(res) - events := s.GetHistory(s.Namespace(), tv.WorkflowExecution()) + events := s.GetHistory(s.Namespace().String(), tv.WorkflowExecution()) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted 2 WorkflowTaskScheduled @@ -1779,7 +1779,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_NotEmptySpeculativeWorkflowTask poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tv.TaskQueue(), Identity: tv.WorkerIdentity(), WorkflowTaskHandler: wtHandler, @@ -1814,7 +1814,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_NotEmptySpeculativeWorkflowTask s.Equal(3, wtHandlerCalls) s.Equal(3, msgHandlerCalls) - events := s.GetHistory(s.Namespace(), tv.WorkflowExecution()) + events := s.GetHistory(s.Namespace().String(), tv.WorkflowExecution()) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted 2 WorkflowTaskScheduled @@ -1962,7 +1962,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_1stAccept_2ndAccept_2ndComplete poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tv.TaskQueue(), Identity: tv.WorkerIdentity(), WorkflowTaskHandler: wtHandler, @@ -2013,7 +2013,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_1stAccept_2ndAccept_2ndComplete s.Equal(4, wtHandlerCalls) s.Equal(4, msgHandlerCalls) - events := s.GetHistory(s.Namespace(), tv.WorkflowExecution()) + events := s.GetHistory(s.Namespace().String(), tv.WorkflowExecution()) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted @@ -2136,7 +2136,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_1stAccept_2ndReject_1stComplete poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tv.TaskQueue(), Identity: tv.WorkerIdentity(), WorkflowTaskHandler: wtHandler, @@ -2178,7 +2178,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_1stAccept_2ndReject_1stComplete s.Equal(3, wtHandlerCalls) s.Equal(3, msgHandlerCalls) - events := s.GetHistory(s.Namespace(), tv.WorkflowExecution()) + events := s.GetHistory(s.Namespace().String(), tv.WorkflowExecution()) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted @@ -2306,7 +2306,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_SpeculativeWorkflowTask_Fail() }) s.NoError(err) - events := s.GetHistory(s.Namespace(), tv.WorkflowExecution()) + events := s.GetHistory(s.Namespace().String(), tv.WorkflowExecution()) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted 2 WorkflowTaskScheduled @@ -2343,7 +2343,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_StartedSpeculativeWorkflowTask_ 6 WorkflowTaskStarted `, task.History) // Send signal which will be buffered. This will persist MS and speculative WT must be converted to normal. - err := s.SendSignal(s.Namespace(), tv.WorkflowExecution(), tv.Any().String(), tv.Any().Payloads(), tv.Any().String()) + err := s.SendSignal(s.Namespace().String(), tv.WorkflowExecution(), tv.Any().String(), tv.Any().Payloads(), tv.Any().String()) s.NoError(err) return nil, nil case 3: @@ -2385,7 +2385,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_StartedSpeculativeWorkflowTask_ poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tv.TaskQueue(), Identity: tv.WorkerIdentity(), WorkflowTaskHandler: wtHandler, @@ -2418,7 +2418,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_StartedSpeculativeWorkflowTask_ s.Equal(3, wtHandlerCalls) s.Equal(3, msgHandlerCalls) - events := s.GetHistory(s.Namespace(), tv.WorkflowExecution()) + events := s.GetHistory(s.Namespace().String(), tv.WorkflowExecution()) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted @@ -2485,7 +2485,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_ScheduledSpeculativeWorkflowTas poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tv.TaskQueue(), Identity: tv.WorkerIdentity(), WorkflowTaskHandler: wtHandler, @@ -2502,7 +2502,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_ScheduledSpeculativeWorkflowTas // Send signal which will NOT be buffered because speculative WT is not started yet (only scheduled). // This will persist MS and speculative WT must be converted to normal. - err = s.SendSignal(s.Namespace(), tv.WorkflowExecution(), tv.Any().String(), tv.Any().Payloads(), tv.Any().String()) + err = s.SendSignal(s.Namespace().String(), tv.WorkflowExecution(), tv.Any().String(), tv.Any().Payloads(), tv.Any().String()) s.NoError(err) // Process update in workflow. @@ -2516,7 +2516,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_ScheduledSpeculativeWorkflowTas s.Equal(2, wtHandlerCalls) s.Equal(2, msgHandlerCalls) - events := s.GetHistory(s.Namespace(), tv.WorkflowExecution()) + events := s.GetHistory(s.Namespace().String(), tv.WorkflowExecution()) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted @@ -2538,7 +2538,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_SpeculativeWorkflowTask_StartTo request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: tv.Any().String(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: tv.WorkflowID(), WorkflowType: tv.WorkflowType(), TaskQueue: tv.TaskQueue(), @@ -2619,7 +2619,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_SpeculativeWorkflowTask_StartTo poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tv.TaskQueue(), Identity: tv.WorkerIdentity(), WorkflowTaskHandler: wtHandler, @@ -2671,7 +2671,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_SpeculativeWorkflowTask_StartTo s.Equal(3, wtHandlerCalls) s.Equal(3, msgHandlerCalls) - events := s.GetHistory(s.Namespace(), tv.WorkflowExecution()) + events := s.GetHistory(s.Namespace().String(), tv.WorkflowExecution()) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted @@ -2732,7 +2732,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_SpeculativeWorkflowTask_Schedul s.NoError(err) s.NotNil(res) - events := s.GetHistory(s.Namespace(), tv.WorkflowExecution()) + events := s.GetHistory(s.Namespace().String(), tv.WorkflowExecution()) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted 2 WorkflowTaskScheduled @@ -2799,7 +2799,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_SpeculativeWorkflowTask_Schedul poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tv.TaskQueue(), Identity: tv.WorkerIdentity(), WorkflowTaskHandler: wtHandler, @@ -2833,7 +2833,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_SpeculativeWorkflowTask_Schedul s.Equal(2, wtHandlerCalls) s.Equal(2, msgHandlerCalls) - events := s.GetHistory(s.Namespace(), tv.WorkflowExecution()) + events := s.GetHistory(s.Namespace().String(), tv.WorkflowExecution()) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted @@ -2863,7 +2863,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_StartedSpeculativeWorkflowTask_ case 2: // Terminate workflow while speculative WT is running. _, err := s.FrontendClient().TerminateWorkflowExecution(testcore.NewContext(), &workflowservice.TerminateWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: tv.WorkflowExecution(), Reason: tv.Any().String(), }) @@ -2900,7 +2900,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_StartedSpeculativeWorkflowTask_ poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tv.TaskQueue(), Identity: tv.WorkerIdentity(), WorkflowTaskHandler: wtHandler, @@ -2933,7 +2933,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_StartedSpeculativeWorkflowTask_ s.Equal(2, wtHandlerCalls) s.Equal(2, msgHandlerCalls) - events := s.GetHistory(s.Namespace(), tv.WorkflowExecution()) + events := s.GetHistory(s.Namespace().String(), tv.WorkflowExecution()) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted @@ -2946,7 +2946,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_StartedSpeculativeWorkflowTask_ 8 WorkflowExecutionTerminated`, events) msResp, err := s.AdminClient().DescribeMutableState(testcore.NewContext(), &adminservice.DescribeMutableStateRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: tv.WorkflowExecution(), }) s.NoError(err) @@ -2985,7 +2985,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_ScheduledSpeculativeWorkflowTas poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tv.TaskQueue(), Identity: tv.WorkerIdentity(), WorkflowTaskHandler: wtHandler, @@ -3004,7 +3004,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_ScheduledSpeculativeWorkflowTas // Terminate workflow after speculative WT is scheduled but not started. _, err = s.FrontendClient().TerminateWorkflowExecution(testcore.NewContext(), &workflowservice.TerminateWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: tv.WorkflowExecution(), Reason: tv.Any().String(), }) @@ -3020,7 +3020,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_ScheduledSpeculativeWorkflowTas s.Equal(1, wtHandlerCalls) s.Equal(1, msgHandlerCalls) - events := s.GetHistory(s.Namespace(), tv.WorkflowExecution()) + events := s.GetHistory(s.Namespace().String(), tv.WorkflowExecution()) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted @@ -3031,7 +3031,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_ScheduledSpeculativeWorkflowTas `, events) msResp, err := s.AdminClient().DescribeMutableState(testcore.NewContext(), &adminservice.DescribeMutableStateRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: tv.WorkflowExecution(), }) s.NoError(err) @@ -3174,7 +3174,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_CompleteWorkflow_AbortUpdates() poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tv.TaskQueue(), Identity: tv.WorkerIdentity(), WorkflowTaskHandler: wtHandler, @@ -3214,7 +3214,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_CompleteWorkflow_AbortUpdates() // Check that update didn't block workflow completion. descResp, err := s.FrontendClient().DescribeWorkflowExecution(testcore.NewContext(), &workflowservice.DescribeWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: tv.WorkflowExecution(), }) s.NoError(err) @@ -3285,7 +3285,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_SpeculativeWorkflowTask_Heartbe s.Equal("rejection-of-"+tv.UpdateID(), updateResult.GetOutcome().GetFailure().GetMessage()) s.EqualValues(0, updateResp.ResetHistoryEventId, "no reset of event ID should happened after update rejection because of heartbeat") - events := s.GetHistory(s.Namespace(), tv.WorkflowExecution()) + events := s.GetHistory(s.Namespace().String(), tv.WorkflowExecution()) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted @@ -3349,7 +3349,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_ScheduledSpeculativeWorkflowTas poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tv.TaskQueue(), Identity: tv.WorkerIdentity(), WorkflowTaskHandler: wtHandler, @@ -3376,7 +3376,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_ScheduledSpeculativeWorkflowTas pollCtx, cancel := context.WithTimeout(testcore.NewContext(), common.MinLongPollTimeout*2) defer cancel() pollResponse, err := s.FrontendClient().PollWorkflowTaskQueue(pollCtx, &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tv.TaskQueue(), Identity: tv.WorkerIdentity(), }) @@ -3384,7 +3384,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_ScheduledSpeculativeWorkflowTas s.Nil(pollResponse.Messages, "there should not be new WFT with messages") // Send signal to schedule new WT. - err = s.SendSignal(s.Namespace(), tv.WorkflowExecution(), tv.Any().String(), tv.Any().Payloads(), tv.Any().String()) + err = s.SendSignal(s.Namespace().String(), tv.WorkflowExecution(), tv.Any().String(), tv.Any().Payloads(), tv.Any().String()) s.NoError(err) // Complete workflow and check that there is update messages. @@ -3395,7 +3395,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_ScheduledSpeculativeWorkflowTas s.Equal(2, wtHandlerCalls) s.Equal(2, msgHandlerCalls) - events := s.GetHistory(s.Namespace(), tv.WorkflowExecution()) + events := s.GetHistory(s.Namespace().String(), tv.WorkflowExecution()) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted @@ -3477,7 +3477,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_StartedSpeculativeWorkflowTask_ poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tv.TaskQueue(), Identity: tv.WorkerIdentity(), WorkflowTaskHandler: wtHandler, @@ -3506,7 +3506,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_StartedSpeculativeWorkflowTask_ s.Nil(updateResult.response) // Send signal to schedule new WFT. - err = s.SendSignal(s.Namespace(), tv.WorkflowExecution(), tv.Any().String(), tv.Any().Payloads(), tv.Any().String()) + err = s.SendSignal(s.Namespace().String(), tv.WorkflowExecution(), tv.Any().String(), tv.Any().Payloads(), tv.Any().String()) s.NoError(err) // Complete workflow. @@ -3517,7 +3517,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_StartedSpeculativeWorkflowTask_ s.Equal(3, wtHandlerCalls) s.Equal(3, msgHandlerCalls) - events := s.GetHistory(s.Namespace(), tv.WorkflowExecution()) + events := s.GetHistory(s.Namespace().String(), tv.WorkflowExecution()) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted @@ -3592,7 +3592,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_FirstNormalWorkflowTask_UpdateR poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tv.TaskQueue(), Identity: tv.WorkerIdentity(), WorkflowTaskHandler: wtHandler, @@ -3613,7 +3613,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_FirstNormalWorkflowTask_UpdateR s.EqualValues("success-result-of-"+tv.UpdateID(), testcore.DecodeString(s.T(), updateResult.GetOutcome().GetSuccess())) // Signal to create new WFT which shouldn't get any updates. - err = s.SendSignal(s.Namespace(), tv.WorkflowExecution(), tv.Any().String(), tv.Any().Payloads(), tv.Any().String()) + err = s.SendSignal(s.Namespace().String(), tv.WorkflowExecution(), tv.Any().String(), tv.Any().Payloads(), tv.Any().String()) s.NoError(err) // Complete workflow. @@ -3624,7 +3624,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_FirstNormalWorkflowTask_UpdateR s.Equal(2, wtHandlerCalls) s.Equal(2, msgHandlerCalls) - events := s.GetHistory(s.Namespace(), tv.WorkflowExecution()) + events := s.GetHistory(s.Namespace().String(), tv.WorkflowExecution()) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted @@ -3687,7 +3687,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_ScheduledSpeculativeWorkflowTas poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tv.TaskQueue(), Identity: tv.WorkerIdentity(), WorkflowTaskHandler: wtHandler, @@ -3718,7 +3718,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_ScheduledSpeculativeWorkflowTas s.Equal(2, wtHandlerCalls) s.Equal(2, msgHandlerCalls) - events := s.GetHistory(s.Namespace(), tv.WorkflowExecution()) + events := s.GetHistory(s.Namespace().String(), tv.WorkflowExecution()) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted @@ -3784,7 +3784,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_StartedSpeculativeWorkflowTask_ poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tv.TaskQueue(), WorkflowTaskHandler: wtHandler, MessageHandler: msgHandler, @@ -3812,7 +3812,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_StartedSpeculativeWorkflowTask_ s.Equal(2, wtHandlerCalls) s.Equal(2, msgHandlerCalls) - events := s.GetHistory(s.Namespace(), tv.WorkflowExecution()) + events := s.GetHistory(s.Namespace().String(), tv.WorkflowExecution()) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted @@ -3896,7 +3896,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_CompletedSpeculativeWorkflowTas poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tv.TaskQueue(), Identity: tv.WorkerIdentity(), WorkflowTaskHandler: wtHandler, @@ -3929,7 +3929,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_CompletedSpeculativeWorkflowTas pollCtx, cancel := context.WithTimeout(testcore.NewContext(), common.MinLongPollTimeout*2) defer cancel() pollResponse, err := s.FrontendClient().PollWorkflowTaskQueue(pollCtx, &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tv.TaskQueue(), Identity: tv.WorkerIdentity(), }) @@ -3942,7 +3942,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_CompletedSpeculativeWorkflowTas "results of the first update must be available") // Send signal to schedule new WT. - err = s.SendSignal(s.Namespace(), tv.WorkflowExecution(), tv.Any().String(), tv.Any().Payloads(), tv.Any().String()) + err = s.SendSignal(s.Namespace().String(), tv.WorkflowExecution(), tv.Any().String(), tv.Any().Payloads(), tv.Any().String()) s.NoError(err) // Complete workflow. @@ -3953,7 +3953,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_CompletedSpeculativeWorkflowTas s.Equal(3, wtHandlerCalls) s.Equal(3, msgHandlerCalls) - events := s.GetHistory(s.Namespace(), tv.WorkflowExecution()) + events := s.GetHistory(s.Namespace().String(), tv.WorkflowExecution()) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted @@ -4016,7 +4016,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_StaleSpeculativeWorkflowTask_Fa poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tv.TaskQueue(), WorkflowTaskHandler: wtHandler, ActivityTaskHandler: atHandler, @@ -4034,7 +4034,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_StaleSpeculativeWorkflowTask_Fa // Poll 2nd speculative WT with 1st update. wt2, err := s.FrontendClient().PollWorkflowTaskQueue(testcore.NewContext(), &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tv.TaskQueue(), }) s.NoError(err) @@ -4064,7 +4064,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_StaleSpeculativeWorkflowTask_Fa // Poll the 3rd WFT (not speculative anymore) but must have 2nd update. wt3, err := s.FrontendClient().PollWorkflowTaskQueue(testcore.NewContext(), &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tv.TaskQueue(), }) s.NoError(err) @@ -4086,7 +4086,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_StaleSpeculativeWorkflowTask_Fa // Now try to complete 2nd WT (speculative). It should fail because WorkflowTaskStarted event Id is mismatched. _, err = s.FrontendClient().RespondWorkflowTaskCompleted(testcore.NewContext(), &workflowservice.RespondWorkflowTaskCompletedRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskToken: wt2.TaskToken, Commands: s.UpdateAcceptCompleteCommands(tv), Messages: s.UpdateAcceptCompleteMessages(tv, wt2.Messages[0]), @@ -4097,14 +4097,14 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_StaleSpeculativeWorkflowTask_Fa // Complete 3rd WT. It should succeed. _, err = s.FrontendClient().RespondWorkflowTaskCompleted(testcore.NewContext(), &workflowservice.RespondWorkflowTaskCompletedRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskToken: wt3.TaskToken, Commands: s.UpdateAcceptCompleteCommands(tv), Messages: s.UpdateAcceptCompleteMessages(tv, wt3.Messages[0]), }) s.NoError(err) - events := s.GetHistory(s.Namespace(), tv.WorkflowExecution()) + events := s.GetHistory(s.Namespace().String(), tv.WorkflowExecution()) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted 2 WorkflowTaskScheduled @@ -4147,7 +4147,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_StaleSpeculativeWorkflowTask_Fa poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tv.TaskQueue(), WorkflowTaskHandler: wtHandler, Logger: s.Logger, @@ -4164,7 +4164,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_StaleSpeculativeWorkflowTask_Fa // Poll 2nd speculative WT with 1st update. wt2, err := s.FrontendClient().PollWorkflowTaskQueue(testcore.NewContext(), &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tv.TaskQueue(), }) s.NoError(err) @@ -4189,7 +4189,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_StaleSpeculativeWorkflowTask_Fa // Poll for the 3rd speculative WT. wt3, err := s.FrontendClient().PollWorkflowTaskQueue(testcore.NewContext(), &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tv.TaskQueue(), }) s.NoError(err) @@ -4208,7 +4208,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_StaleSpeculativeWorkflowTask_Fa // Now try to complete 2nd (speculative) WT, it should fail. _, err = s.FrontendClient().RespondWorkflowTaskCompleted(testcore.NewContext(), &workflowservice.RespondWorkflowTaskCompletedRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskToken: wt2.TaskToken, Commands: s.UpdateAcceptCompleteCommands(tv), Messages: s.UpdateAcceptCompleteMessages(tv, wt2.Messages[0]), @@ -4219,14 +4219,14 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_StaleSpeculativeWorkflowTask_Fa // Try to complete 3rd WT, it should succeed _, err = s.FrontendClient().RespondWorkflowTaskCompleted(testcore.NewContext(), &workflowservice.RespondWorkflowTaskCompletedRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskToken: wt3.TaskToken, Commands: s.UpdateAcceptCompleteCommands(tv), Messages: s.UpdateAcceptCompleteMessages(tv, wt3.Messages[0]), }) s.NoError(err, "2nd speculative WT should be completed because it has same WT scheduled/started Id and startTime matches the accepted message is valid (same update Id)") - events := s.GetHistory(s.Namespace(), tv.WorkflowExecution()) + events := s.GetHistory(s.Namespace().String(), tv.WorkflowExecution()) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted 2 WorkflowTaskScheduled @@ -4260,13 +4260,13 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_StaleSpeculativeWorkflowTask_Fa // Drain first WFT. wt1, err := s.FrontendClient().PollWorkflowTaskQueue(testCtx, &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tv.TaskQueue(), }) s.NoError(err) s.NotNil(wt1) _, err = s.FrontendClient().RespondWorkflowTaskCompleted(testCtx, &workflowservice.RespondWorkflowTaskCompletedRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskToken: wt1.TaskToken, }) s.NoError(err) @@ -4276,7 +4276,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_StaleSpeculativeWorkflowTask_Fa // Poll 2nd speculative WFT with 1st update. wt2, err := s.FrontendClient().PollWorkflowTaskQueue(testCtx, &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tv.TaskQueue(), }) s.NoError(err) @@ -4305,7 +4305,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_StaleSpeculativeWorkflowTask_Fa // Poll the 3rd speculative WFT. wt3, err := s.FrontendClient().PollWorkflowTaskQueue(testCtx, &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tv.TaskQueue(), }) s.NoError(err) @@ -4325,7 +4325,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_StaleSpeculativeWorkflowTask_Fa // Now try to complete 2nd speculative WT, it should fail because start time does not match. _, err = s.FrontendClient().RespondWorkflowTaskCompleted(testCtx, &workflowservice.RespondWorkflowTaskCompletedRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskToken: wt2.TaskToken, Commands: s.UpdateAcceptCompleteCommands(tv1), Messages: s.UpdateAcceptCompleteMessages(tv1, wt2.Messages[0]), @@ -4337,7 +4337,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_StaleSpeculativeWorkflowTask_Fa // Complete of the 3rd WT should succeed. It must accept both updates. wt4Resp, err := s.FrontendClient().RespondWorkflowTaskCompleted(testCtx, &workflowservice.RespondWorkflowTaskCompletedRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskToken: wt3.TaskToken, Commands: append( s.UpdateAcceptCompleteCommands(tv1), @@ -4350,7 +4350,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_StaleSpeculativeWorkflowTask_Fa s.NoError(err) s.NotNil(wt4Resp) - events := s.GetHistory(s.Namespace(), tv.WorkflowExecution()) + events := s.GetHistory(s.Namespace().String(), tv.WorkflowExecution()) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted 2 WorkflowTaskScheduled @@ -4441,7 +4441,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_SpeculativeWorkflowTask_WorkerS poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tv.TaskQueue(), WorkflowTaskHandler: wtHandler, MessageHandler: msgHandler, @@ -4474,7 +4474,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_SpeculativeWorkflowTask_WorkerS s.Equal(3, wtHandlerCalls) s.Equal(3, msgHandlerCalls) - events := s.GetHistory(s.Namespace(), tv.WorkflowExecution()) + events := s.GetHistory(s.Namespace().String(), tv.WorkflowExecution()) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted 2 WorkflowTaskScheduled @@ -4494,7 +4494,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_LastWorkflowTask_HasUpdateMessa poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tv.TaskQueue(), Identity: tv.WorkerIdentity(), WorkflowTaskHandler: func(task *workflowservice.PollWorkflowTaskQueueResponse) ([]*commandpb.Command, error) { @@ -4529,7 +4529,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_LastWorkflowTask_HasUpdateMessa 4 WorkflowTaskCompleted 5 WorkflowExecutionUpdateAccepted 6 WorkflowExecutionCompleted - `, s.GetHistory(s.Namespace(), tv.WorkflowExecution())) + `, s.GetHistory(s.Namespace().String(), tv.WorkflowExecution())) } func (s *UpdateWorkflowSuite) TestUpdateWorkflow_SpeculativeWorkflowTask_QueryFailureClearsWFContext() { @@ -4583,7 +4583,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_SpeculativeWorkflowTask_QueryFa poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tv.TaskQueue(), WorkflowTaskHandler: wtHandler, MessageHandler: msgHandler, @@ -4609,7 +4609,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_SpeculativeWorkflowTask_QueryFa shortCtx, cancel := context.WithTimeout(testcore.NewContext(), 100*time.Millisecond) defer cancel() queryResp, err := s.FrontendClient().QueryWorkflow(shortCtx, &workflowservice.QueryWorkflowRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: tv.WorkflowExecution(), Query: &querypb.WorkflowQuery{ QueryType: tv.Any().String(), @@ -4661,7 +4661,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_SpeculativeWorkflowTask_QueryFa s.Equal(2, wtHandlerCalls) s.Equal(2, msgHandlerCalls) - events := s.GetHistory(s.Namespace(), tv.WorkflowExecution()) + events := s.GetHistory(s.Namespace().String(), tv.WorkflowExecution()) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted @@ -4694,7 +4694,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_UpdatesAreSentToWorkerInOrderOf msgHandlerCalls := 0 poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tv.TaskQueue(), Identity: tv.WorkerIdentity(), WorkflowTaskHandler: func(task *workflowservice.PollWorkflowTaskQueueResponse) ([]*commandpb.Command, error) { @@ -4739,7 +4739,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_UpdatesAreSentToWorkerInOrderOf 6+2*i, tvi.UpdateID()) } - history := s.GetHistory(s.Namespace(), tv.WorkflowExecution()) + history := s.GetHistory(s.Namespace().String(), tv.WorkflowExecution()) s.EqualHistoryEvents(expectedHistory, history) } @@ -4749,7 +4749,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_WaitAccepted_GotCompleted() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tv.TaskQueue(), Identity: tv.WorkerIdentity(), WorkflowTaskHandler: func(task *workflowservice.PollWorkflowTaskQueueResponse) ([]*commandpb.Command, error) { @@ -4778,7 +4778,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_WaitAccepted_GotCompleted() { 4 WorkflowTaskCompleted 5 WorkflowExecutionUpdateAccepted 6 WorkflowExecutionUpdateCompleted - `, s.GetHistory(s.Namespace(), tv.WorkflowExecution())) + `, s.GetHistory(s.Namespace().String(), tv.WorkflowExecution())) } func (s *UpdateWorkflowSuite) TestUpdateWorkflow_ContinueAsNew_UpdateIsNotCarriedOver() { @@ -4803,7 +4803,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_ContinueAsNew_UpdateIsNotCarrie poller1 := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tv.TaskQueue(), Identity: tv.WorkerIdentity(), WorkflowTaskHandler: func(task *workflowservice.PollWorkflowTaskQueueResponse) ([]*commandpb.Command, error) { @@ -4827,7 +4827,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_ContinueAsNew_UpdateIsNotCarrie poller2 := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tv.WithTaskQueueNumber(2).TaskQueue(), Identity: tv.WorkerIdentity(), WorkflowTaskHandler: func(task *workflowservice.PollWorkflowTaskQueueResponse) ([]*commandpb.Command, error) { @@ -4864,13 +4864,13 @@ func (s *UpdateWorkflowSuite) TestUpdateWorkflow_ContinueAsNew_UpdateIsNotCarrie 3 WorkflowTaskStarted 4 WorkflowTaskCompleted 5 WorkflowExecutionUpdateAccepted - 6 WorkflowExecutionContinuedAsNew`, s.GetHistory(s.Namespace(), tv.WithRunID(firstRunID).WorkflowExecution())) + 6 WorkflowExecutionContinuedAsNew`, s.GetHistory(s.Namespace().String(), tv.WithRunID(firstRunID).WorkflowExecution())) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted 2 WorkflowTaskScheduled 3 WorkflowTaskStarted - 4 WorkflowTaskCompleted`, s.GetHistory(s.Namespace(), tv.WorkflowExecution())) + 4 WorkflowTaskCompleted`, s.GetHistory(s.Namespace().String(), tv.WorkflowExecution())) } func (s *UpdateWorkflowSuite) TestUpdateWithStart() { @@ -4892,7 +4892,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWithStart() { resp, err := s.FrontendClient().ExecuteMultiOperation( ctx, &workflowservice.ExecuteMultiOperationRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Operations: []*workflowservice.ExecuteMultiOperationRequest_Operation{ { Operation: &workflowservice.ExecuteMultiOperationRequest_Operation_StartWorkflow{ @@ -4928,7 +4928,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWithStart() { startWorkflowReq := func(tv *testvars.TestVars) *workflowservice.StartWorkflowExecutionRequest { return &workflowservice.StartWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: tv.WorkflowID(), WorkflowType: tv.WorkflowType(), TaskQueue: tv.TaskQueue(), @@ -4981,7 +4981,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWithStart() { 3 WorkflowTaskStarted 4 WorkflowTaskCompleted 5 WorkflowExecutionUpdateAccepted - 6 WorkflowExecutionUpdateCompleted`, s.GetHistory(s.Namespace(), tv.WorkflowExecution())) + 6 WorkflowExecutionUpdateCompleted`, s.GetHistory(s.Namespace().String(), tv.WorkflowExecution())) }) s.Run("and reject", func() { @@ -5017,7 +5017,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWithStart() { 1 WorkflowExecutionStarted 2 WorkflowTaskScheduled 3 WorkflowTaskStarted - 4 WorkflowTaskCompleted`, s.GetHistory(s.Namespace(), tv.WorkflowExecution())) + 4 WorkflowTaskCompleted`, s.GetHistory(s.Namespace().String(), tv.WorkflowExecution())) }) }) } @@ -5074,7 +5074,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWithStart() { 6 WorkflowTaskStarted 7 WorkflowTaskCompleted 8 WorkflowExecutionUpdateAccepted - 9 WorkflowExecutionUpdateCompleted`, s.GetHistory(s.Namespace(), tv.WorkflowExecution())) + 9 WorkflowExecutionUpdateCompleted`, s.GetHistory(s.Namespace().String(), tv.WorkflowExecution())) }) s.Run("and reject", func() { @@ -5120,7 +5120,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWithStart() { 2 WorkflowTaskScheduled 3 WorkflowTaskStarted 4 WorkflowTaskCompleted - `, s.GetHistory(s.Namespace(), tv.WorkflowExecution())) + `, s.GetHistory(s.Namespace().String(), tv.WorkflowExecution())) }) }) @@ -5161,7 +5161,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWithStart() { // ensure workflow was terminated descResp, err := s.FrontendClient().DescribeWorkflowExecution(testcore.NewContext(), &workflowservice.DescribeWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: &commonpb.WorkflowExecution{WorkflowId: startReq.WorkflowId, RunId: firstWF.RunId}, }) s.NoError(err) @@ -5259,7 +5259,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWithStart() { _, err = s.FrontendClient().TerminateWorkflowExecution(testcore.NewContext(), &workflowservice.TerminateWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: tv.WorkflowExecution(), Reason: tv.Any().String(), }) @@ -5288,7 +5288,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWithStart() { s.EqualValues("success-result-of-"+tv.UpdateID(), testcore.DecodeString(s.T(), updateRep.GetOutcome().GetSuccess())) // ensure terminated workflow is not locked by update-with-start - err = s.SendSignal(s.Namespace(), &commonpb.WorkflowExecution{ + err = s.SendSignal(s.Namespace().String(), &commonpb.WorkflowExecution{ WorkflowId: tv.WorkflowID(), RunId: initialWorkflow.RunId, }, tv.Any().String(), tv.Any().Payloads(), tv.Any().String()) @@ -5313,7 +5313,7 @@ func (s *UpdateWorkflowSuite) TestUpdateWithStart() { _, err = s.FrontendClient().TerminateWorkflowExecution(testcore.NewContext(), &workflowservice.TerminateWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: tv.WorkflowExecution(), Reason: tv.Any().String(), }) @@ -5362,7 +5362,7 @@ func (s *UpdateWorkflowSuite) closeShard(wid string) { s.T().Helper() resp, err := s.FrontendClient().DescribeNamespace(testcore.NewContext(), &workflowservice.DescribeNamespaceRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), }) s.NoError(err) diff --git a/tests/user_metadata_test.go b/tests/user_metadata_test.go index d9325bd60b9..f8d3b8ce8be 100644 --- a/tests/user_metadata_test.go +++ b/tests/user_metadata_test.go @@ -74,7 +74,7 @@ func (s *UserMetadataSuite) TestUserMetadata() { metadata := prepareTestUserMetadata() request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: tv.WorkflowID(), WorkflowType: tv.WorkflowType(), TaskQueue: tv.TaskQueue(), @@ -85,7 +85,7 @@ func (s *UserMetadataSuite) TestUserMetadata() { s.NoError(err) // Verify that the UserMetadata associated with the start event is returned in the describe response. - describeInfo, err := getDescribeWorkflowExecutionInfo(s.FrontendClient(), s.Namespace(), tv.WorkflowID(), we.RunId) + describeInfo, err := getDescribeWorkflowExecutionInfo(s.FrontendClient(), s.Namespace().String(), tv.WorkflowID(), we.RunId) s.NoError(err) s.EqualExportedValues(metadata, describeInfo.ExecutionConfig.UserMetadata) }) @@ -95,7 +95,7 @@ func (s *UserMetadataSuite) TestUserMetadata() { metadata := prepareTestUserMetadata() request := &workflowservice.SignalWithStartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: tv.WorkflowID(), WorkflowType: tv.WorkflowType(), TaskQueue: tv.TaskQueue(), @@ -107,7 +107,7 @@ func (s *UserMetadataSuite) TestUserMetadata() { s.NoError(err) // Verify that the UserMetadata associated with the start event is returned in the describe response. - describeInfo, err := getDescribeWorkflowExecutionInfo(s.FrontendClient(), s.Namespace(), tv.WorkflowID(), we.RunId) + describeInfo, err := getDescribeWorkflowExecutionInfo(s.FrontendClient(), s.Namespace().String(), tv.WorkflowID(), we.RunId) s.NoError(err) s.EqualExportedValues(metadata, describeInfo.ExecutionConfig.UserMetadata) }) @@ -117,14 +117,14 @@ func (s *UserMetadataSuite) TestUserMetadata() { metadata := prepareTestUserMetadata() startWorkflowRequest := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: tv.WorkflowID(), WorkflowType: tv.WorkflowType(), TaskQueue: tv.TaskQueue(), UserMetadata: metadata, } updateWorkflowRequest := &workflowservice.UpdateWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: &commonpb.WorkflowExecution{WorkflowId: tv.WorkflowID()}, Request: &updatepb.Request{ Meta: &updatepb.Meta{UpdateId: "UPDATE_ID"}, @@ -132,7 +132,7 @@ func (s *UserMetadataSuite) TestUserMetadata() { }, } request := &workflowservice.ExecuteMultiOperationRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Operations: []*workflowservice.ExecuteMultiOperationRequest_Operation{ { // start workflow operation Operation: &workflowservice.ExecuteMultiOperationRequest_Operation_StartWorkflow{ @@ -151,7 +151,7 @@ func (s *UserMetadataSuite) TestUserMetadata() { s.NoError(err) // Verify that the UserMetadata associated with the start event is returned in the describe response. - describeInfo, err := getDescribeWorkflowExecutionInfo(s.FrontendClient(), s.Namespace(), tv.WorkflowID(), "") + describeInfo, err := getDescribeWorkflowExecutionInfo(s.FrontendClient(), s.Namespace().String(), tv.WorkflowID(), "") s.NoError(err) s.EqualExportedValues(metadata, describeInfo.ExecutionConfig.UserMetadata) }) diff --git a/tests/user_timers_test.go b/tests/user_timers_test.go index 4c908abb176..d8e0fa5f7e4 100644 --- a/tests/user_timers_test.go +++ b/tests/user_timers_test.go @@ -61,7 +61,7 @@ func (s *UserTimersTestSuite) TestUserTimers_Sequential() { request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: &commonpb.WorkflowType{Name: wt}, TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, @@ -104,7 +104,7 @@ func (s *UserTimersTestSuite) TestUserTimers_Sequential() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, Identity: identity, WorkflowTaskHandler: wtHandler, diff --git a/tests/versioning_3_test.go b/tests/versioning_3_test.go index 3dc3ecc2fe9..0fa9588892c 100644 --- a/tests/versioning_3_test.go +++ b/tests/versioning_3_test.go @@ -463,7 +463,7 @@ func (s *Versioning3Suite) nexusTaskStaysOnCurrentDeployment() { tv2 := tv1.WithBuildIDNumber(2) nexusRequest := &matchingservice.DispatchNexusTaskRequest{ - NamespaceId: s.GetNamespaceID(s.Namespace()), + NamespaceId: s.NamespaceID().String(), TaskQueue: tv1.TaskQueue(), Request: &nexuspb.Request{ Header: map[string]string{ @@ -752,7 +752,7 @@ func (s *Versioning3Suite) setCurrentDeployment( defer cancel() _, err := s.FrontendClient().SetCurrentDeployment(ctx, &workflowservice.SetCurrentDeploymentRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Deployment: deployment, }) s.NoError(err) @@ -770,7 +770,7 @@ func (s *Versioning3Suite) updateTaskQueueDeploymentData( for _, t := range tqTypes { _, err := s.GetTestCluster().MatchingClient().SyncDeploymentUserData( ctx, &matchingservice.SyncDeploymentUserDataRequest{ - NamespaceId: s.GetNamespaceID(s.Namespace()), + NamespaceId: s.NamespaceID().String(), TaskQueue: tv.TaskQueue().GetName(), TaskQueueType: t, Deployment: tv.Deployment(), @@ -794,7 +794,7 @@ func (s *Versioning3Suite) verifyWorkflowVersioning( ) { dwf, err := s.FrontendClient().DescribeWorkflowExecution( context.Background(), &workflowservice.DescribeWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: &commonpb.WorkflowExecution{ WorkflowId: tv.WorkflowID(), }, @@ -944,7 +944,7 @@ func (s *Versioning3Suite) startWorkflow( ) *commonpb.WorkflowExecution { request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: tv.WorkflowID(), WorkflowType: tv.WorkflowType(), TaskQueue: tv.TaskQueue(), @@ -967,7 +967,7 @@ func (s *Versioning3Suite) queryWorkflow( tv *testvars.TestVars, ) (*workflowservice.QueryWorkflowResponse, error) { request := &workflowservice.QueryWorkflowRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: tv.WorkflowExecution(), Query: &querypb.WorkflowQuery{ QueryType: tv.Any().String(), @@ -1002,7 +1002,7 @@ func (s *Versioning3Suite) pollWftAndHandle( async chan<- interface{}, handler func(task *workflowservice.PollWorkflowTaskQueueResponse) (*workflowservice.RespondWorkflowTaskCompletedRequest, error), ) (*taskpoller.TaskPoller, *workflowservice.RespondWorkflowTaskCompletedResponse) { - poller := taskpoller.New(s.T(), s.FrontendClient(), s.Namespace()) + poller := taskpoller.New(s.T(), s.FrontendClient(), s.Namespace().String()) d := tv.Deployment() tq := tv.TaskQueue() if sticky { @@ -1039,7 +1039,7 @@ func (s *Versioning3Suite) pollWftAndHandleQueries( async chan<- interface{}, handler func(task *workflowservice.PollWorkflowTaskQueueResponse) (*workflowservice.RespondQueryTaskCompletedRequest, error), ) (*taskpoller.TaskPoller, *workflowservice.RespondQueryTaskCompletedResponse) { - poller := taskpoller.New(s.T(), s.FrontendClient(), s.Namespace()) + poller := taskpoller.New(s.T(), s.FrontendClient(), s.Namespace().String()) d := tv.Deployment() tq := tv.TaskQueue() if sticky { @@ -1075,7 +1075,7 @@ func (s *Versioning3Suite) pollNexusTaskAndHandle( async chan<- interface{}, handler func(task *workflowservice.PollNexusTaskQueueResponse) (*workflowservice.RespondNexusTaskCompletedRequest, error), ) (*taskpoller.TaskPoller, *workflowservice.RespondNexusTaskCompletedResponse) { - poller := taskpoller.New(s.T(), s.FrontendClient(), s.Namespace()) + poller := taskpoller.New(s.T(), s.FrontendClient(), s.Namespace().String()) d := tv.Deployment() tq := tv.TaskQueue() if sticky { @@ -1110,7 +1110,7 @@ func (s *Versioning3Suite) pollActivityAndHandle( async chan<- interface{}, handler func(task *workflowservice.PollActivityTaskQueueResponse) (*workflowservice.RespondActivityTaskCompletedRequest, error), ) { - poller := taskpoller.New(s.T(), s.FrontendClient(), s.Namespace()) + poller := taskpoller.New(s.T(), s.FrontendClient(), s.Namespace().String()) d := tv.Deployment() f := func() { _, err := poller.PollActivityTask( @@ -1140,7 +1140,7 @@ func (s *Versioning3Suite) idlePollWorkflow( timeout time.Duration, unexpectedTaskMessage string, ) { - poller := taskpoller.New(s.T(), s.FrontendClient(), s.Namespace()) + poller := taskpoller.New(s.T(), s.FrontendClient(), s.Namespace().String()) d := tv.Deployment() _, _ = poller.PollWorkflowTask( &workflowservice.PollWorkflowTaskQueueRequest{ @@ -1166,7 +1166,7 @@ func (s *Versioning3Suite) idlePollActivity( timeout time.Duration, unexpectedTaskMessage string, ) { - poller := taskpoller.New(s.T(), s.FrontendClient(), s.Namespace()) + poller := taskpoller.New(s.T(), s.FrontendClient(), s.Namespace().String()) d := tv.Deployment() _, _ = poller.PollActivityTask( &workflowservice.PollActivityTaskQueueRequest{ @@ -1195,7 +1195,7 @@ func (s *Versioning3Suite) idlePollNexus( timeout time.Duration, unexpectedTaskMessage string, ) { - poller := taskpoller.New(s.T(), s.FrontendClient(), s.Namespace()) + poller := taskpoller.New(s.T(), s.FrontendClient(), s.Namespace().String()) d := tv.Deployment() _, _ = poller.PollNexusTask( &workflowservice.PollNexusTaskQueueRequest{ @@ -1222,7 +1222,7 @@ func (s *Versioning3Suite) verifyWorkflowStickyQueue( ) { ms, err := s.GetTestCluster().HistoryClient().GetMutableState( context.Background(), &historyservice.GetMutableStateRequest{ - NamespaceId: s.GetNamespaceID(s.Namespace()), + NamespaceId: s.NamespaceID().String(), Execution: we, }, ) @@ -1235,7 +1235,7 @@ func (s *Versioning3Suite) verifyWorkflowStickyQueue( func (s *Versioning3Suite) warmUpSticky( tv *testvars.TestVars, ) { - poller := taskpoller.New(s.T(), s.FrontendClient(), s.Namespace()) + poller := taskpoller.New(s.T(), s.FrontendClient(), s.Namespace().String()) _, _ = poller.PollWorkflowTask( &workflowservice.PollWorkflowTaskQueueRequest{ TaskQueue: tv.StickyTaskQueue(), @@ -1273,8 +1273,7 @@ func (s *Versioning3Suite) waitForDeploymentDataPropagation( remaining[partAndType{i, tqt}] = struct{}{} } } - nsId := s.GetNamespaceID(s.Namespace()) - f, err := tqid.NewTaskQueueFamily(nsId, tv.TaskQueue().GetName()) + f, err := tqid.NewTaskQueueFamily(s.NamespaceID().String(), tv.TaskQueue().GetName()) deployment := tv.Deployment() s.Eventually(func() bool { for pt := range remaining { @@ -1285,7 +1284,7 @@ func (s *Versioning3Suite) waitForDeploymentDataPropagation( res, err := s.GetTestCluster().MatchingClient().GetTaskQueueUserData( ctx, &matchingservice.GetTaskQueueUserDataRequest{ - NamespaceId: nsId, + NamespaceId: s.NamespaceID().String(), TaskQueue: partition.RpcName(), TaskQueueType: partition.TaskType(), }) diff --git a/tests/versioning_test.go b/tests/versioning_test.go index 1d650ac6398..1951f31cbe2 100644 --- a/tests/versioning_test.go +++ b/tests/versioning_test.go @@ -139,7 +139,7 @@ func (s *VersioningIntegSuite) SetupTest() { sdkClient, err := sdkclient.Dial(sdkclient.Options{ HostPort: s.FrontendGRPCAddress(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), }) if err != nil { s.Logger.Fatal("Error when creating SDK client", tag.Error(err)) @@ -413,7 +413,7 @@ func (s *VersioningIntegSuite) TestBasicVersionUpdate() { s.addNewDefaultBuildId(ctx, tq, foo) res2, err := s.FrontendClient().GetWorkerBuildIdCompatibility(ctx, &workflowservice.GetWorkerBuildIdCompatibilityRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tq, }) s.NoError(err) @@ -431,7 +431,7 @@ func (s *VersioningIntegSuite) TestSeriesOfUpdates() { s.addCompatibleBuildId(ctx, tq, s.prefixed("foo-2.1"), s.prefixed("foo-2"), false) res, err := s.FrontendClient().GetWorkerBuildIdCompatibility(ctx, &workflowservice.GetWorkerBuildIdCompatibilityRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tq, }) s.NoError(err) @@ -446,7 +446,7 @@ func (s *VersioningIntegSuite) TestLinkToNonexistentCompatibleVersionReturnsNotF tq := "functional-versioning-compat-not-found" res, err := s.FrontendClient().UpdateWorkerBuildIdCompatibility(ctx, &workflowservice.UpdateWorkerBuildIdCompatibilityRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tq, Operation: &workflowservice.UpdateWorkerBuildIdCompatibilityRequest_AddNewCompatibleBuildId{ AddNewCompatibleBuildId: &workflowservice.UpdateWorkerBuildIdCompatibilityRequest_AddNewCompatibleVersion{ @@ -470,7 +470,7 @@ func (s *VersioningIntegSuite) TestVersioningStatePersistsAcrossUnload() { s.unloadTaskQueue(ctx, tq) res, err := s.FrontendClient().GetWorkerBuildIdCompatibility(ctx, &workflowservice.GetWorkerBuildIdCompatibilityRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tq, }) s.NoError(err) @@ -501,7 +501,7 @@ func (s *VersioningIntegSuite) TestMaxTaskQueuesPerBuildIdEnforced() { for i := 1; i <= 3; i++ { taskQueue := fmt.Sprintf("q-%s-%d", s.T().Name(), i) _, err := s.FrontendClient().UpdateWorkerBuildIdCompatibility(ctx, &workflowservice.UpdateWorkerBuildIdCompatibilityRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Operation: &workflowservice.UpdateWorkerBuildIdCompatibilityRequest_AddNewBuildIdInNewDefaultSet{ AddNewBuildIdInNewDefaultSet: buildId, @@ -513,7 +513,7 @@ func (s *VersioningIntegSuite) TestMaxTaskQueuesPerBuildIdEnforced() { // Map a fourth task queue to this build ID and verify it errors taskQueue := fmt.Sprintf("q-%s-%d", s.T().Name(), 4) _, err := s.FrontendClient().UpdateWorkerBuildIdCompatibility(ctx, &workflowservice.UpdateWorkerBuildIdCompatibilityRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Operation: &workflowservice.UpdateWorkerBuildIdCompatibilityRequest_AddNewBuildIdInNewDefaultSet{ AddNewBuildIdInNewDefaultSet: buildId, @@ -524,7 +524,7 @@ func (s *VersioningIntegSuite) TestMaxTaskQueuesPerBuildIdEnforced() { s.Equal("Exceeded max task queues allowed to be mapped to a single build ID: 3", failedPreconditionError.Message) } -//func (s *VersioningIntegSuite) testWithMatchingBehavior(subtest func()) { +// func (s *VersioningIntegSuite) testWithMatchingBehavior(subtest func()) { // for _, forceForward := range []bool{false, true} { // for _, forceAsync := range []bool{false, true} { // name := "NoForward" @@ -558,7 +558,7 @@ func (s *VersioningIntegSuite) TestMaxTaskQueuesPerBuildIdEnforced() { // }) // } // } -//} +// } func (s *VersioningIntegSuite) TestDispatchNewWorkflowOld() { s.RunTestWithMatchingBehavior(func() { s.dispatchNewWorkflow(false) }) @@ -1803,7 +1803,7 @@ func (s *VersioningIntegSuite) dispatchUpgrade(newVersioning, stopOld bool) { } else { // Don't stop the old worker. if !newVersioning { - //In this case, w1 will still have some pollers blocked on + // In this case, w1 will still have some pollers blocked on // the normal queue which could pick up tasks that we want to go to v11. (We don't // interrupt long polls.) To ensure those polls don't interfere, wait for them to // expire. @@ -2477,7 +2477,7 @@ func (s *VersioningIntegSuite) TestDispatchActivityEager() { s.Require().NoError(err) pollResponse, err := s.sdkClient.WorkflowService().PollWorkflowTaskQueue(ctx, &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{Name: tq}, Identity: "test", WorkerVersionCapabilities: &commonpb.WorkerVersionCapabilities{ @@ -2718,7 +2718,7 @@ func (s *VersioningIntegSuite) dispatchChildWorkflow(newVersioning bool, crossTq s.NoError(err) // wait for it to start on v1 s.WaitForChannel(ctx, started) - close(started) //force panic if replayed + close(started) // force panic if replayed // now register v2 as default if newVersioning { @@ -3969,7 +3969,7 @@ func (s *VersioningIntegSuite) validateBuildIdAfterReset(ctx context.Context, wf // now reset the wf to first wf task wfr, err := s.sdkClient.ResetWorkflowExecution(ctx, &workflowservice.ResetWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: &commonpb.WorkflowExecution{ WorkflowId: run.GetID(), RunId: run.GetRunID(), @@ -3996,7 +3996,7 @@ func (s *VersioningIntegSuite) validateBuildIdAfterReset(ctx context.Context, wf // now reset the original wf to second wf task and make sure it remains in v1 wfr, err = s.sdkClient.ResetWorkflowExecution(ctx, &workflowservice.ResetWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: &commonpb.WorkflowExecution{ WorkflowId: run.GetID(), RunId: run.GetRunID(), @@ -4045,7 +4045,7 @@ func (s *VersioningIntegSuite) TestDescribeTaskQueueEnhanced_Versioned_Reachabil s.Eventually(func() bool { queryARunning := fmt.Sprintf("TaskQueue = '%s' AND BuildIds IN ('assigned:A') AND ExecutionStatus = \"Running\"", tq) resp, err := s.FrontendClient().CountWorkflowExecutions(ctx, &workflowservice.CountWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Query: queryARunning, }) s.Nil(err) @@ -4113,7 +4113,7 @@ func (s *VersioningIntegSuite) TestDescribeTaskQueueEnhanced_Versioned_BasicReac s.Eventually(func() bool { queryARunning := fmt.Sprintf("TaskQueue = '%s' AND BuildIds IN ('assigned:A') AND ExecutionStatus = \"Running\"", tq) resp, err := s.FrontendClient().CountWorkflowExecutions(ctx, &workflowservice.CountWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Query: queryARunning, }) s.Nil(err) @@ -4164,7 +4164,7 @@ func (s *VersioningIntegSuite) TestDescribeTaskQueueEnhanced_Unversioned() { s.Eventually(func() bool { resp, err := s.FrontendClient().DescribeTaskQueue(ctx, &workflowservice.DescribeTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{Name: tq, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, ApiMode: enumspb.DESCRIBE_TASK_QUEUE_MODE_ENHANCED, Versions: nil, // default version, in this case unversioned queue @@ -4215,7 +4215,7 @@ func (s *VersioningIntegSuite) TestDescribeTaskQueueEnhanced_ReportFlags() { // wait for pollers to show up, verify both ReportPollers and ReportTaskReachability s.Eventually(func() bool { resp, err := s.FrontendClient().DescribeTaskQueue(ctx, &workflowservice.DescribeTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{Name: tq, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, ApiMode: enumspb.DESCRIBE_TASK_QUEUE_MODE_ENHANCED, Versions: nil, // default version, in this case unversioned queue @@ -4244,7 +4244,7 @@ func (s *VersioningIntegSuite) TestDescribeTaskQueueEnhanced_ReportFlags() { // ask for reachability only resp, err := s.FrontendClient().DescribeTaskQueue(ctx, &workflowservice.DescribeTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{Name: tq, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, ApiMode: enumspb.DESCRIBE_TASK_QUEUE_MODE_ENHANCED, Versions: nil, // default version, in this case unversioned queue @@ -4262,7 +4262,7 @@ func (s *VersioningIntegSuite) TestDescribeTaskQueueEnhanced_ReportFlags() { // ask for pollers only resp, err = s.FrontendClient().DescribeTaskQueue(ctx, &workflowservice.DescribeTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{Name: tq, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, ApiMode: enumspb.DESCRIBE_TASK_QUEUE_MODE_ENHANCED, Versions: nil, // default version, in this case unversioned queue @@ -4286,7 +4286,7 @@ func (s *VersioningIntegSuite) TestDescribeTaskQueueEnhanced_TooManyBuildIds() { buildIds := []string{"A", "B", "C", "D"} resp, err := s.FrontendClient().DescribeTaskQueue(ctx, &workflowservice.DescribeTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{Name: tq, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, ApiMode: enumspb.DESCRIBE_TASK_QUEUE_MODE_ENHANCED, Versions: &taskqueuepb.TaskQueueVersionSelection{BuildIds: buildIds}, @@ -4299,7 +4299,7 @@ func (s *VersioningIntegSuite) TestDescribeTaskQueueEnhanced_TooManyBuildIds() { buildIds = []string{"A", "B", "C", "D", "E"} resp, err = s.FrontendClient().DescribeTaskQueue(ctx, &workflowservice.DescribeTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{Name: tq, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, ApiMode: enumspb.DESCRIBE_TASK_QUEUE_MODE_ENHANCED, Versions: &taskqueuepb.TaskQueueVersionSelection{BuildIds: buildIds}, @@ -4360,7 +4360,7 @@ func (s *VersioningIntegSuite) TestDescribeTaskQueueLegacy_VersionSets() { s.Eventually(func() bool { resp, err := s.FrontendClient().DescribeTaskQueue(ctx, &workflowservice.DescribeTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{Name: tq, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, TaskQueueType: enumspb.TASK_QUEUE_TYPE_WORKFLOW, }) @@ -4467,7 +4467,7 @@ func (s *VersioningIntegSuite) prefixed(buildId string) string { func (s *VersioningIntegSuite) getVersioningRules( ctx context.Context, tq string) *workflowservice.GetWorkerVersioningRulesResponse { res, err := s.FrontendClient().GetWorkerVersioningRules(ctx, &workflowservice.GetWorkerVersioningRulesRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tq, }) s.NoError(err) @@ -4481,7 +4481,7 @@ func (s *VersioningIntegSuite) insertAssignmentRule( ctx context.Context, tq, newBuildId string, idx int32, conflictToken []byte, expectSuccess bool) []byte { res, err := s.FrontendClient().UpdateWorkerVersioningRules(ctx, &workflowservice.UpdateWorkerVersioningRulesRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tq, ConflictToken: conflictToken, Operation: &workflowservice.UpdateWorkerVersioningRulesRequest_InsertAssignmentRule{ @@ -4511,7 +4511,7 @@ func (s *VersioningIntegSuite) replaceAssignmentRule( ctx context.Context, tq, newBuildId string, idx int32, conflictToken []byte, expectSuccess bool) []byte { res, err := s.FrontendClient().UpdateWorkerVersioningRules(ctx, &workflowservice.UpdateWorkerVersioningRulesRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tq, ConflictToken: conflictToken, Operation: &workflowservice.UpdateWorkerVersioningRulesRequest_ReplaceAssignmentRule{ @@ -4541,7 +4541,7 @@ func (s *VersioningIntegSuite) deleteAssignmentRule( ctx context.Context, tq string, idx int32, conflictToken []byte, expectSuccess bool) []byte { getResp, err := s.FrontendClient().GetWorkerVersioningRules(ctx, &workflowservice.GetWorkerVersioningRulesRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tq, }) s.NoError(err) @@ -4553,7 +4553,7 @@ func (s *VersioningIntegSuite) deleteAssignmentRule( } res, err := s.FrontendClient().UpdateWorkerVersioningRules(ctx, &workflowservice.UpdateWorkerVersioningRulesRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tq, ConflictToken: conflictToken, Operation: &workflowservice.UpdateWorkerVersioningRulesRequest_DeleteAssignmentRule{ @@ -4587,7 +4587,7 @@ func (s *VersioningIntegSuite) insertRedirectRule( ctx context.Context, tq, sourceBuildId, targetBuildId string, conflictToken []byte, expectSuccess bool) []byte { res, err := s.FrontendClient().UpdateWorkerVersioningRules(ctx, &workflowservice.UpdateWorkerVersioningRulesRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tq, ConflictToken: conflictToken, Operation: &workflowservice.UpdateWorkerVersioningRulesRequest_AddCompatibleRedirectRule{ @@ -4624,7 +4624,7 @@ func (s *VersioningIntegSuite) replaceRedirectRule( ctx context.Context, tq, sourceBuildId, targetBuildId string, conflictToken []byte, expectSuccess bool) []byte { res, err := s.FrontendClient().UpdateWorkerVersioningRules(ctx, &workflowservice.UpdateWorkerVersioningRulesRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tq, ConflictToken: conflictToken, Operation: &workflowservice.UpdateWorkerVersioningRulesRequest_ReplaceCompatibleRedirectRule{ @@ -4661,7 +4661,7 @@ func (s *VersioningIntegSuite) deleteRedirectRule( ctx context.Context, tq, sourceBuildId string, conflictToken []byte, expectSuccess bool) []byte { res, err := s.FrontendClient().UpdateWorkerVersioningRules(ctx, &workflowservice.UpdateWorkerVersioningRulesRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tq, ConflictToken: conflictToken, Operation: &workflowservice.UpdateWorkerVersioningRulesRequest_DeleteCompatibleRedirectRule{ @@ -4695,7 +4695,7 @@ func (s *VersioningIntegSuite) commitBuildId( ctx context.Context, tq, targetBuildId string, force bool, conflictToken []byte, expectSuccess bool) []byte { res, err := s.FrontendClient().UpdateWorkerVersioningRules(ctx, &workflowservice.UpdateWorkerVersioningRulesRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tq, ConflictToken: conflictToken, Operation: &workflowservice.UpdateWorkerVersioningRulesRequest_CommitBuildId_{ @@ -4760,7 +4760,7 @@ func (s *VersioningIntegSuite) getBuildIdReachability( versions *taskqueuepb.TaskQueueVersionSelection, expectedReachability map[string]enumspb.BuildIdTaskReachability) { resp, err := s.FrontendClient().DescribeTaskQueue(ctx, &workflowservice.DescribeTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{Name: taskQueue, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, ApiMode: enumspb.DESCRIBE_TASK_QUEUE_MODE_ENHANCED, Versions: versions, @@ -4783,7 +4783,7 @@ func (s *VersioningIntegSuite) checkBuildIdReachability( versions *taskqueuepb.TaskQueueVersionSelection, expectedReachability map[string]enumspb.BuildIdTaskReachability) bool { resp, err := s.FrontendClient().DescribeTaskQueue(ctx, &workflowservice.DescribeTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{Name: taskQueue, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, ApiMode: enumspb.DESCRIBE_TASK_QUEUE_MODE_ENHANCED, Versions: versions, @@ -4812,7 +4812,7 @@ func (s *VersioningIntegSuite) checkBuildIdReachability( // addNewDefaultBuildId updates build ID info on a task queue with a new build ID in a new default set. func (s *VersioningIntegSuite) addNewDefaultBuildId(ctx context.Context, tq, newBuildId string) { res, err := s.FrontendClient().UpdateWorkerBuildIdCompatibility(ctx, &workflowservice.UpdateWorkerBuildIdCompatibilityRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tq, Operation: &workflowservice.UpdateWorkerBuildIdCompatibilityRequest_AddNewBuildIdInNewDefaultSet{ AddNewBuildIdInNewDefaultSet: newBuildId, @@ -4841,7 +4841,7 @@ func (s *VersioningIntegSuite) addAssignmentRuleWithRamp(ctx context.Context, tq func (s *VersioningIntegSuite) doAddAssignmentRule(ctx context.Context, tq string, rule *taskqueuepb.BuildIdAssignmentRule) *taskqueuepb.BuildIdAssignmentRule { cT := s.getVersioningRules(ctx, tq).GetConflictToken() res, err := s.FrontendClient().UpdateWorkerVersioningRules(ctx, &workflowservice.UpdateWorkerVersioningRulesRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tq, ConflictToken: cT, Operation: &workflowservice.UpdateWorkerVersioningRulesRequest_InsertAssignmentRule{ @@ -4862,7 +4862,7 @@ func (s *VersioningIntegSuite) addRedirectRule(ctx context.Context, tq, source s TargetBuildId: target, } res, err := s.FrontendClient().UpdateWorkerVersioningRules(ctx, &workflowservice.UpdateWorkerVersioningRulesRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tq, ConflictToken: cT, Operation: &workflowservice.UpdateWorkerVersioningRulesRequest_AddCompatibleRedirectRule{ @@ -4879,7 +4879,7 @@ func (s *VersioningIntegSuite) addRedirectRule(ctx context.Context, tq, source s func (s *VersioningIntegSuite) removeRedirectRule(ctx context.Context, tq, source string) { cT := s.getVersioningRules(ctx, tq).GetConflictToken() res, err := s.FrontendClient().UpdateWorkerVersioningRules(ctx, &workflowservice.UpdateWorkerVersioningRulesRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tq, ConflictToken: cT, Operation: &workflowservice.UpdateWorkerVersioningRulesRequest_DeleteCompatibleRedirectRule{ @@ -4895,7 +4895,7 @@ func (s *VersioningIntegSuite) removeRedirectRule(ctx context.Context, tq, sourc // addCompatibleBuildId updates build ID info on a task queue with a new compatible build ID. func (s *VersioningIntegSuite) addCompatibleBuildId(ctx context.Context, tq, newBuildId, existing string, makeSetDefault bool) { res, err := s.FrontendClient().UpdateWorkerBuildIdCompatibility(ctx, &workflowservice.UpdateWorkerBuildIdCompatibilityRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tq, Operation: &workflowservice.UpdateWorkerBuildIdCompatibilityRequest_AddNewCompatibleBuildId{ AddNewCompatibleBuildId: &workflowservice.UpdateWorkerBuildIdCompatibilityRequest_AddNewCompatibleVersion{ @@ -4990,10 +4990,9 @@ func (s *VersioningIntegSuite) waitForPropagation( remaining[partAndType{i, enumspb.TASK_QUEUE_TYPE_ACTIVITY}] = struct{}{} remaining[partAndType{i, enumspb.TASK_QUEUE_TYPE_WORKFLOW}] = struct{}{} } - nsId := s.GetNamespaceID(s.Namespace()) s.Eventually(func() bool { for pt := range remaining { - f, err := tqid.NewTaskQueueFamily(nsId, taskQueue) + f, err := tqid.NewTaskQueueFamily(s.NamespaceID().String(), taskQueue) s.NoError(err) partition := f.TaskQueue(pt.tp).NormalPartition(pt.part) // Use lower-level GetTaskQueueUserData instead of GetWorkerBuildIdCompatibility @@ -5001,7 +5000,7 @@ func (s *VersioningIntegSuite) waitForPropagation( res, err := s.GetTestCluster().Host().MatchingClient().GetTaskQueueUserData( ctx, &matchingservice.GetTaskQueueUserDataRequest{ - NamespaceId: nsId, + NamespaceId: s.NamespaceID().String(), TaskQueue: partition.RpcName(), TaskQueueType: partition.TaskType(), }) @@ -5016,7 +5015,7 @@ func (s *VersioningIntegSuite) waitForPropagation( func (s *VersioningIntegSuite) unloadTaskQueue(ctx context.Context, tq string) { _, err := s.GetTestCluster().MatchingClient().ForceUnloadTaskQueuePartition(ctx, &matchingservice.ForceUnloadTaskQueuePartitionRequest{ - NamespaceId: s.GetNamespaceID(s.Namespace()), + NamespaceId: s.NamespaceID().String(), TaskQueuePartition: &taskqueuespb.TaskQueuePartition{ TaskQueue: tq, TaskQueueType: enumspb.TASK_QUEUE_TYPE_WORKFLOW, @@ -5027,7 +5026,7 @@ func (s *VersioningIntegSuite) unloadTaskQueue(ctx context.Context, tq string) { func (s *VersioningIntegSuite) getStickyQueueName(ctx context.Context, id string) string { ms, err := s.AdminClient().DescribeMutableState(ctx, &adminservice.DescribeMutableStateRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: &commonpb.WorkflowExecution{WorkflowId: id}, }) s.NoError(err) diff --git a/tests/workflow_buffered_events_test.go b/tests/workflow_buffered_events_test.go index cd91fdc4480..63920aeb8ff 100644 --- a/tests/workflow_buffered_events_test.go +++ b/tests/workflow_buffered_events_test.go @@ -63,7 +63,7 @@ func (s *WorkflowBufferedEventsTestSuite) TestRateLimitBufferedEvents() { // Start workflow execution request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: &commonpb.WorkflowType{Name: wt}, TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, @@ -102,13 +102,13 @@ func (s *WorkflowBufferedEventsTestSuite) TestRateLimitBufferedEvents() { buf := new(bytes.Buffer) err := binary.Write(buf, binary.LittleEndian, byte(i)) s.NoError(err) - s.Nil(s.SendSignal(s.Namespace(), workflowExecution, "SignalName", payloads.EncodeBytes(buf.Bytes()), identity)) + s.Nil(s.SendSignal(s.Namespace().String(), workflowExecution, "SignalName", payloads.EncodeBytes(buf.Bytes()), identity)) } buf := new(bytes.Buffer) err := binary.Write(buf, binary.LittleEndian, byte(101)) s.NoError(err) - signalErr := s.SendSignal(s.Namespace(), workflowExecution, "SignalName", payloads.EncodeBytes(buf.Bytes()), identity) + signalErr := s.SendSignal(s.Namespace().String(), workflowExecution, "SignalName", payloads.EncodeBytes(buf.Bytes()), identity) s.NoError(signalErr) // this command will be ignored as workflow task has already failed @@ -126,7 +126,7 @@ func (s *WorkflowBufferedEventsTestSuite) TestRateLimitBufferedEvents() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -161,7 +161,7 @@ func (s *WorkflowBufferedEventsTestSuite) TestBufferedEvents() { // Start workflow execution request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: &commonpb.WorkflowType{Name: wt}, TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, @@ -187,7 +187,7 @@ func (s *WorkflowBufferedEventsTestSuite) TestBufferedEvents() { // this will create new event when there is in-flight workflow task, and the new event will be buffered _, err := s.FrontendClient().SignalWorkflowExecution(testcore.NewContext(), &workflowservice.SignalWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: &commonpb.WorkflowExecution{ WorkflowId: id, }, @@ -228,7 +228,7 @@ func (s *WorkflowBufferedEventsTestSuite) TestBufferedEvents() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -243,7 +243,7 @@ func (s *WorkflowBufferedEventsTestSuite) TestBufferedEvents() { s.NoError(err) // check history, the signal event should be after the complete workflow task - historyEvents := s.GetHistory(s.Namespace(), &commonpb.WorkflowExecution{ + historyEvents := s.GetHistory(s.Namespace().String(), &commonpb.WorkflowExecution{ WorkflowId: id, RunId: we.RunId, }) @@ -276,7 +276,7 @@ func (s *WorkflowBufferedEventsTestSuite) TestBufferedEventsOutOfOrder() { // Start workflow execution request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: &commonpb.WorkflowType{Name: wt}, TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, @@ -349,7 +349,7 @@ func (s *WorkflowBufferedEventsTestSuite) TestBufferedEventsOutOfOrder() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -389,7 +389,7 @@ func (s *WorkflowBufferedEventsTestSuite) TestBufferedEventsOutOfOrder() { s.NoError(err) s.Nil(task.WorkflowTask) - events := s.GetHistory(s.Namespace(), workflowExecution) + events := s.GetHistory(s.Namespace().String(), workflowExecution) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted 2 WorkflowTaskScheduled diff --git a/tests/workflow_delete_execution_test.go b/tests/workflow_delete_execution_test.go index d357eb34747..35a06b7a6b1 100644 --- a/tests/workflow_delete_execution_test.go +++ b/tests/workflow_delete_execution_test.go @@ -71,7 +71,7 @@ func (s *WorkflowDeleteExecutionSuite) TestDeleteWorkflowExecution_CompetedWorkf for i := 0; i < numExecutions; i++ { we, err := s.FrontendClient().StartWorkflowExecution(testcore.NewContext(), &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: tv.WithWorkflowIDNumber(i).WorkflowID(), WorkflowType: tv.WorkflowType(), TaskQueue: tv.TaskQueue(), @@ -94,7 +94,7 @@ func (s *WorkflowDeleteExecutionSuite) TestDeleteWorkflowExecution_CompetedWorkf poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: tv.TaskQueue(), Identity: tv.WorkerIdentity(), WorkflowTaskHandler: wtHandler, @@ -114,7 +114,7 @@ func (s *WorkflowDeleteExecutionSuite) TestDeleteWorkflowExecution_CompetedWorkf visibilityResponse, err := s.FrontendClient().ListWorkflowExecutions( testcore.NewContext(), &workflowservice.ListWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), PageSize: 1, NextPageToken: nil, Query: fmt.Sprintf("WorkflowId='%s'", we.WorkflowId), @@ -135,7 +135,7 @@ func (s *WorkflowDeleteExecutionSuite) TestDeleteWorkflowExecution_CompetedWorkf // Delete workflow executions. for _, we := range wes { _, err := s.FrontendClient().DeleteWorkflowExecution(testcore.NewContext(), &workflowservice.DeleteWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: &commonpb.WorkflowExecution{ WorkflowId: we.WorkflowId, RunId: we.RunId, @@ -151,7 +151,7 @@ func (s *WorkflowDeleteExecutionSuite) TestDeleteWorkflowExecution_CompetedWorkf describeResponse, err := s.FrontendClient().DescribeWorkflowExecution( testcore.NewContext(), &workflowservice.DescribeWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: we, }, ) @@ -172,7 +172,7 @@ func (s *WorkflowDeleteExecutionSuite) TestDeleteWorkflowExecution_CompetedWorkf historyResponse, err := s.FrontendClient().GetWorkflowExecutionHistory( testcore.NewContext(), &workflowservice.GetWorkflowExecutionHistoryRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: we, }, ) @@ -186,7 +186,7 @@ func (s *WorkflowDeleteExecutionSuite) TestDeleteWorkflowExecution_CompetedWorkf visibilityResponse, err := s.FrontendClient().ListWorkflowExecutions( testcore.NewContext(), &workflowservice.ListWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), PageSize: 1, NextPageToken: nil, Query: fmt.Sprintf("WorkflowId='%s'", we.WorkflowId), @@ -215,7 +215,7 @@ func (s *WorkflowDeleteExecutionSuite) TestDeleteWorkflowExecution_RunningWorkfl for i := 0; i < numExecutions; i++ { we, err := s.FrontendClient().StartWorkflowExecution(testcore.NewContext(), &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: tv.WithWorkflowIDNumber(i).WorkflowID(), WorkflowType: tv.WorkflowType(), TaskQueue: tv.TaskQueue(), @@ -235,7 +235,7 @@ func (s *WorkflowDeleteExecutionSuite) TestDeleteWorkflowExecution_RunningWorkfl visibilityResponse, err := s.FrontendClient().ListWorkflowExecutions( testcore.NewContext(), &workflowservice.ListWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), PageSize: 1, NextPageToken: nil, Query: fmt.Sprintf("WorkflowId='%s'", we.WorkflowId), @@ -253,7 +253,7 @@ func (s *WorkflowDeleteExecutionSuite) TestDeleteWorkflowExecution_RunningWorkfl // Delete workflow executions. for _, we := range wes { _, err := s.FrontendClient().DeleteWorkflowExecution(testcore.NewContext(), &workflowservice.DeleteWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: we, }) s.NoError(err) @@ -266,7 +266,7 @@ func (s *WorkflowDeleteExecutionSuite) TestDeleteWorkflowExecution_RunningWorkfl describeResponse, err := s.FrontendClient().DescribeWorkflowExecution( testcore.NewContext(), &workflowservice.DescribeWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: we, }, ) @@ -287,7 +287,7 @@ func (s *WorkflowDeleteExecutionSuite) TestDeleteWorkflowExecution_RunningWorkfl historyResponse, err := s.FrontendClient().GetWorkflowExecutionHistory( testcore.NewContext(), &workflowservice.GetWorkflowExecutionHistoryRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: we, }, ) @@ -301,7 +301,7 @@ func (s *WorkflowDeleteExecutionSuite) TestDeleteWorkflowExecution_RunningWorkfl visibilityResponse, err := s.FrontendClient().ListWorkflowExecutions( testcore.NewContext(), &workflowservice.ListWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), PageSize: 1, NextPageToken: nil, Query: fmt.Sprintf("WorkflowId='%s'", we.WorkflowId), @@ -330,7 +330,7 @@ func (s *WorkflowDeleteExecutionSuite) TestDeleteWorkflowExecution_JustTerminate for i := 0; i < numExecutions; i++ { we, err := s.FrontendClient().StartWorkflowExecution(testcore.NewContext(), &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: tv.WithWorkflowIDNumber(i).WorkflowID(), WorkflowType: tv.WorkflowType(), TaskQueue: tv.TaskQueue(), @@ -350,7 +350,7 @@ func (s *WorkflowDeleteExecutionSuite) TestDeleteWorkflowExecution_JustTerminate visibilityResponse, err := s.FrontendClient().ListWorkflowExecutions( testcore.NewContext(), &workflowservice.ListWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), PageSize: 1, NextPageToken: nil, Query: fmt.Sprintf("WorkflowId='%s'", we.WorkflowId), @@ -375,13 +375,13 @@ func (s *WorkflowDeleteExecutionSuite) TestDeleteWorkflowExecution_JustTerminate for i, we := range wes { _, err := s.FrontendClient().TerminateWorkflowExecution(testcore.NewContext(), &workflowservice.TerminateWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: we, }) s.NoError(err) s.Logger.Warn("Execution is terminated", tag.NewInt("number", i), tag.WorkflowID(we.WorkflowId), tag.WorkflowRunID(we.RunId)) _, err = s.FrontendClient().DeleteWorkflowExecution(testcore.NewContext(), &workflowservice.DeleteWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: we, }) s.NoError(err) @@ -395,7 +395,7 @@ func (s *WorkflowDeleteExecutionSuite) TestDeleteWorkflowExecution_JustTerminate describeResponse, err := s.FrontendClient().DescribeWorkflowExecution( testcore.NewContext(), &workflowservice.DescribeWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: we, }, ) @@ -416,7 +416,7 @@ func (s *WorkflowDeleteExecutionSuite) TestDeleteWorkflowExecution_JustTerminate historyResponse, err := s.FrontendClient().GetWorkflowExecutionHistory( testcore.NewContext(), &workflowservice.GetWorkflowExecutionHistoryRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: we, }, ) @@ -430,7 +430,7 @@ func (s *WorkflowDeleteExecutionSuite) TestDeleteWorkflowExecution_JustTerminate visibilityResponse, err := s.FrontendClient().ListWorkflowExecutions( testcore.NewContext(), &workflowservice.ListWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), PageSize: 1, NextPageToken: nil, Query: fmt.Sprintf("WorkflowId='%s'", we.WorkflowId), diff --git a/tests/workflow_failures_test.go b/tests/workflow_failures_test.go index 4d168da343a..abe782122b1 100644 --- a/tests/workflow_failures_test.go +++ b/tests/workflow_failures_test.go @@ -69,7 +69,7 @@ func (s *WorkflowFailuresTestSuite) TestWorkflowTimeout() { request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: &commonpb.WorkflowType{Name: wt}, TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, @@ -89,7 +89,7 @@ func (s *WorkflowFailuresTestSuite) TestWorkflowTimeout() { var historyEvents []*historypb.HistoryEvent GetHistoryLoop: for i := 0; i < 10; i++ { - historyEvents = s.GetHistory(s.Namespace(), &commonpb.WorkflowExecution{ + historyEvents = s.GetHistory(s.Namespace().String(), &commonpb.WorkflowExecution{ WorkflowId: id, RunId: we.RunId, }) @@ -117,7 +117,7 @@ GetHistoryLoop: ListClosedLoop: for i := 0; i < 10; i++ { resp, err3 := s.FrontendClient().ListClosedWorkflowExecutions(testcore.NewContext(), &workflowservice.ListClosedWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), MaximumPageSize: 100, StartTimeFilter: startFilter, Filters: &workflowservice.ListClosedWorkflowExecutionsRequest_ExecutionFilter{ExecutionFilter: &filterpb.WorkflowExecutionFilter{ @@ -146,7 +146,7 @@ func (s *WorkflowFailuresTestSuite) TestWorkflowTaskFailed() { // Start workflow execution request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: &commonpb.WorkflowType{Name: wt}, TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, @@ -188,9 +188,9 @@ func (s *WorkflowFailuresTestSuite) TestWorkflowTaskFailed() { // Send signals during workflow task if sendSignal { - s.NoError(s.SendSignal(s.Namespace(), workflowExecution, "signalC", nil, identity)) - s.NoError(s.SendSignal(s.Namespace(), workflowExecution, "signalD", nil, identity)) - s.NoError(s.SendSignal(s.Namespace(), workflowExecution, "signalE", nil, identity)) + s.NoError(s.SendSignal(s.Namespace().String(), workflowExecution, "signalC", nil, identity)) + s.NoError(s.SendSignal(s.Namespace().String(), workflowExecution, "signalD", nil, identity)) + s.NoError(s.SendSignal(s.Namespace().String(), workflowExecution, "signalE", nil, identity)) sendSignal = false } @@ -241,7 +241,7 @@ func (s *WorkflowFailuresTestSuite) TestWorkflowTaskFailed() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -266,7 +266,7 @@ func (s *WorkflowFailuresTestSuite) TestWorkflowTaskFailed() { s.NoError(err) } - err = s.SendSignal(s.Namespace(), workflowExecution, "signalA", nil, identity) + err = s.SendSignal(s.Namespace().String(), workflowExecution, "signalA", nil, identity) s.NoError(err, "failed to send signal to execution") // process signal @@ -276,7 +276,7 @@ func (s *WorkflowFailuresTestSuite) TestWorkflowTaskFailed() { s.Equal(1, signalCount) // send another signal to trigger workflow task - err = s.SendSignal(s.Namespace(), workflowExecution, "signalB", nil, identity) + err = s.SendSignal(s.Namespace().String(), workflowExecution, "signalB", nil, identity) s.NoError(err, "failed to send signal to execution") // fail workflow task 2 more times @@ -306,7 +306,7 @@ func (s *WorkflowFailuresTestSuite) TestWorkflowTaskFailed() { s.True(workflowComplete) s.Equal(16, signalCount) - events := s.GetHistory(s.Namespace(), workflowExecution) + events := s.GetHistory(s.Namespace().String(), workflowExecution) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted 2 WorkflowTaskScheduled @@ -351,7 +351,7 @@ func (s *WorkflowFailuresTestSuite) TestRespondWorkflowTaskCompleted_ReturnsErro request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: &commonpb.WorkflowType{Name: wt}, TaskQueue: &taskqueuepb.TaskQueue{Name: tq, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, @@ -380,7 +380,7 @@ func (s *WorkflowFailuresTestSuite) TestRespondWorkflowTaskCompleted_ReturnsErro poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{Name: tq, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -394,7 +394,7 @@ func (s *WorkflowFailuresTestSuite) TestRespondWorkflowTaskCompleted_ReturnsErro s.IsType(&serviceerror.InvalidArgument{}, err) s.Equal("BadRecordMarkerAttributes: MarkerName is not set on RecordMarkerCommand.", err.Error()) - historyEvents := s.GetHistory(s.Namespace(), &commonpb.WorkflowExecution{ + historyEvents := s.GetHistory(s.Namespace().String(), &commonpb.WorkflowExecution{ WorkflowId: id, RunId: we0.GetRunId(), }) diff --git a/tests/workflow_memo_test.go b/tests/workflow_memo_test.go index 8a1c8700a32..abf1b72de76 100644 --- a/tests/workflow_memo_test.go +++ b/tests/workflow_memo_test.go @@ -73,7 +73,7 @@ func (s *WorkflowMemoTestSuite) TestStartWithMemo() { request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: &commonpb.WorkflowType{Name: wt}, TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, @@ -111,7 +111,7 @@ func (s *WorkflowMemoTestSuite) TestSignalWithStartWithMemo() { signalInput := payloads.EncodeString("my signal input") request := &workflowservice.SignalWithStartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: &commonpb.WorkflowType{Name: wt}, TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, @@ -156,7 +156,7 @@ func (s *WorkflowMemoTestSuite) startWithMemoHelper(startFn startFunc, id string poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -169,7 +169,7 @@ func (s *WorkflowMemoTestSuite) startWithMemoHelper(startFn startFunc, id string s.Eventually( func() bool { resp, err1 := s.FrontendClient().ListOpenWorkflowExecutions(testcore.NewContext(), &workflowservice.ListOpenWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), MaximumPageSize: 100, StartTimeFilter: &filterpb.StartTimeFilter{ EarliestTime: nil, @@ -200,7 +200,7 @@ func (s *WorkflowMemoTestSuite) startWithMemoHelper(startFn startFunc, id string // verify DescribeWorkflowExecution result: workflow running descRequest := &workflowservice.DescribeWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: execution, } descResp, err := s.FrontendClient().DescribeWorkflowExecution(testcore.NewContext(), descRequest) @@ -213,7 +213,7 @@ func (s *WorkflowMemoTestSuite) startWithMemoHelper(startFn startFunc, id string s.NoError(err) // verify history - historyEvents := s.GetHistory(s.Namespace(), execution) + historyEvents := s.GetHistory(s.Namespace().String(), execution) s.EqualHistoryEvents(expectedHistory, historyEvents) // verify DescribeWorkflowExecution result: workflow closed, but close visibility task not completed @@ -226,7 +226,7 @@ func (s *WorkflowMemoTestSuite) startWithMemoHelper(startFn startFunc, id string s.Eventually( func() bool { resp, err1 := s.FrontendClient().ListClosedWorkflowExecutions(testcore.NewContext(), &workflowservice.ListClosedWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), MaximumPageSize: 100, StartTimeFilter: &filterpb.StartTimeFilter{ EarliestTime: nil, diff --git a/tests/workflow_reset_test.go b/tests/workflow_reset_test.go index de331381e18..1bf9b776666 100644 --- a/tests/workflow_reset_test.go +++ b/tests/workflow_reset_test.go @@ -62,7 +62,7 @@ func (s *WorkflowResetSuite) TestNoBaseCurrentRunning() { // Reset the current run (i.e don't give an explicit runID) resp, err := s.FrontendClient().ResetWorkflowExecution(ctx, &workflowservice.ResetWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: &commonpb.WorkflowExecution{WorkflowId: workflowID}, Reason: "testing-reset", RequestId: uuid.NewString(), @@ -73,7 +73,7 @@ func (s *WorkflowResetSuite) TestNoBaseCurrentRunning() { // Current run is the assumed base run. The new run should be linked to this one. currentMutableState, err := s.AdminClient().DescribeMutableState(ctx, &adminservice.DescribeMutableStateRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: &commonpb.WorkflowExecution{WorkflowId: workflowID, RunId: currentRunID}, }) s.NoError(err) @@ -90,7 +90,7 @@ func (s *WorkflowResetSuite) TestNoBaseCurrentClosed() { // Reset the current run (i.e don't give an explicit runID) resp, err := s.FrontendClient().ResetWorkflowExecution(ctx, &workflowservice.ResetWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: &commonpb.WorkflowExecution{WorkflowId: workflowID}, Reason: "testing-reset", RequestId: uuid.NewString(), @@ -101,7 +101,7 @@ func (s *WorkflowResetSuite) TestNoBaseCurrentClosed() { // Current run is the assumed base run. The new run should be linked to this one. currentMutableState, err := s.AdminClient().DescribeMutableState(ctx, &adminservice.DescribeMutableStateRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: &commonpb.WorkflowExecution{WorkflowId: workflowID, RunId: currentRunID}, }) s.NoError(err) @@ -209,7 +209,7 @@ func (s *WorkflowResetSuite) TestOriginalExecutionRunId() { for i := 0; i < 5; i++ { currentRunID := s.performReset(ctx, workflowID, baseRunID) baseMutableState, err := s.AdminClient().DescribeMutableState(ctx, &adminservice.DescribeMutableStateRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: &commonpb.WorkflowExecution{WorkflowId: workflowID, RunId: currentRunID}, }) s.NoError(err) @@ -237,7 +237,7 @@ func (s *WorkflowResetSuite) getFirstWFTaskCompleteEventID(ctx context.Context, func (s *WorkflowResetSuite) performReset(ctx context.Context, workflowID string, runID string) string { // Reset the workflow by providing the explicit runID (base run) to reset. resp, err := s.FrontendClient().ResetWorkflowExecution(ctx, &workflowservice.ResetWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: &commonpb.WorkflowExecution{WorkflowId: workflowID, RunId: runID}, Reason: "testing-reset", RequestId: uuid.NewString(), @@ -250,7 +250,7 @@ func (s *WorkflowResetSuite) performReset(ctx context.Context, workflowID string // assertMutableStateStatus asserts that the mutable state for the given run matches the expected status. func (s *WorkflowResetSuite) assertMutableStateStatus(ctx context.Context, workflowID string, runID string, expectedStatus enumspb.WorkflowExecutionStatus) { ms, err := s.AdminClient().DescribeMutableState(ctx, &adminservice.DescribeMutableStateRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: &commonpb.WorkflowExecution{WorkflowId: workflowID, RunId: runID}, }) s.NoError(err) @@ -260,7 +260,7 @@ func (s *WorkflowResetSuite) assertMutableStateStatus(ctx context.Context, workf // assertResetWorkflowLink asserts that the reset runID is properly recorded in the given run. func (s *WorkflowResetSuite) assertResetWorkflowLink(ctx context.Context, workflowID string, runID string, expectedLinkRunID string) { baseMutableState, err := s.AdminClient().DescribeMutableState(ctx, &adminservice.DescribeMutableStateRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: &commonpb.WorkflowExecution{WorkflowId: workflowID, RunId: runID}, }) s.NoError(err) @@ -292,7 +292,7 @@ func (s *WorkflowResetSuite) prepareSingleRun(ctx context.Context, workflowID st s.NoError(err) pollWTResp, err := s.FrontendClient().PollWorkflowTaskQueue(ctx, &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: "test", }) @@ -322,7 +322,7 @@ func (s *WorkflowResetSuite) prepareSingleRun(ctx context.Context, workflowID st } pollATResp, err := s.FrontendClient().PollActivityTaskQueue(ctx, &workflowservice.PollActivityTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: identity, }) @@ -333,7 +333,7 @@ func (s *WorkflowResetSuite) prepareSingleRun(ctx context.Context, workflowID st s.NoError(err) pollWTResp, err = s.FrontendClient().PollWorkflowTaskQueue(ctx, &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: "test", }) diff --git a/tests/workflow_task_test.go b/tests/workflow_task_test.go index 2062362ada4..b4a3d7bc7a0 100644 --- a/tests/workflow_task_test.go +++ b/tests/workflow_task_test.go @@ -63,7 +63,7 @@ func (s *WorkflowTaskTestSuite) TestWorkflowTaskHeartbeatingWithEmptyResult() { request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -83,11 +83,11 @@ func (s *WorkflowTaskTestSuite) TestWorkflowTaskHeartbeatingWithEmptyResult() { s.EqualHistoryEvents(` 1 WorkflowExecutionStarted - 2 WorkflowTaskScheduled`, s.GetHistory(s.Namespace(), we)) + 2 WorkflowTaskScheduled`, s.GetHistory(s.Namespace().String(), we)) // start workflow task resp1, err1 := s.FrontendClient().PollWorkflowTaskQueue(testcore.NewContext(), &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: identity, }) @@ -97,13 +97,13 @@ func (s *WorkflowTaskTestSuite) TestWorkflowTaskHeartbeatingWithEmptyResult() { s.EqualHistoryEvents(` 1 WorkflowExecutionStarted 2 WorkflowTaskScheduled - 3 WorkflowTaskStarted`, s.GetHistory(s.Namespace(), we)) + 3 WorkflowTaskStarted`, s.GetHistory(s.Namespace().String(), we)) taskToken := resp1.GetTaskToken() hbTimeout := 0 for i := 0; i < 12; i++ { resp2, err2 := s.FrontendClient().RespondWorkflowTaskCompleted(testcore.NewContext(), &workflowservice.RespondWorkflowTaskCompletedRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskToken: taskToken, Commands: []*commandpb.Command{}, StickyAttributes: &taskqueuepb.StickyExecutionAttributes{ @@ -118,7 +118,7 @@ func (s *WorkflowTaskTestSuite) TestWorkflowTaskHeartbeatingWithEmptyResult() { s.IsType(&workflowservice.RespondWorkflowTaskCompletedResponse{}, resp2) resp, err := s.FrontendClient().PollWorkflowTaskQueue(testcore.NewContext(), &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: identity, }) @@ -134,7 +134,7 @@ func (s *WorkflowTaskTestSuite) TestWorkflowTaskHeartbeatingWithEmptyResult() { s.Equal(2, hbTimeout) resp5, err5 := s.FrontendClient().RespondWorkflowTaskCompleted(testcore.NewContext(), &workflowservice.RespondWorkflowTaskCompletedRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskToken: taskToken, Commands: []*commandpb.Command{ { @@ -201,7 +201,7 @@ func (s *WorkflowTaskTestSuite) TestWorkflowTaskHeartbeatingWithEmptyResult() { 44 WorkflowTaskScheduled 45 WorkflowTaskStarted 46 WorkflowTaskCompleted - 47 WorkflowExecutionCompleted`, s.GetHistory(s.Namespace(), we)) + 47 WorkflowExecutionCompleted`, s.GetHistory(s.Namespace().String(), we)) } func (s *WorkflowTaskTestSuite) TestWorkflowTaskHeartbeatingWithLocalActivitiesResult() { @@ -217,7 +217,7 @@ func (s *WorkflowTaskTestSuite) TestWorkflowTaskHeartbeatingWithLocalActivitiesR request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -237,11 +237,11 @@ func (s *WorkflowTaskTestSuite) TestWorkflowTaskHeartbeatingWithLocalActivitiesR s.EqualHistoryEvents(` 1 WorkflowExecutionStarted - 2 WorkflowTaskScheduled`, s.GetHistory(s.Namespace(), we)) + 2 WorkflowTaskScheduled`, s.GetHistory(s.Namespace().String(), we)) // start workflow task resp1, err1 := s.FrontendClient().PollWorkflowTaskQueue(testcore.NewContext(), &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: identity, }) @@ -251,10 +251,10 @@ func (s *WorkflowTaskTestSuite) TestWorkflowTaskHeartbeatingWithLocalActivitiesR s.EqualHistoryEvents(` 1 WorkflowExecutionStarted 2 WorkflowTaskScheduled - 3 WorkflowTaskStarted`, s.GetHistory(s.Namespace(), we)) + 3 WorkflowTaskStarted`, s.GetHistory(s.Namespace().String(), we)) resp2, err2 := s.FrontendClient().RespondWorkflowTaskCompleted(testcore.NewContext(), &workflowservice.RespondWorkflowTaskCompletedRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskToken: resp1.GetTaskToken(), Commands: []*commandpb.Command{}, StickyAttributes: &taskqueuepb.StickyExecutionAttributes{ @@ -267,7 +267,7 @@ func (s *WorkflowTaskTestSuite) TestWorkflowTaskHeartbeatingWithLocalActivitiesR s.NoError(err2) resp3, err3 := s.FrontendClient().RespondWorkflowTaskCompleted(testcore.NewContext(), &workflowservice.RespondWorkflowTaskCompletedRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskToken: resp2.WorkflowTask.GetTaskToken(), Commands: []*commandpb.Command{ { @@ -289,7 +289,7 @@ func (s *WorkflowTaskTestSuite) TestWorkflowTaskHeartbeatingWithLocalActivitiesR s.NoError(err3) resp4, err4 := s.FrontendClient().RespondWorkflowTaskCompleted(testcore.NewContext(), &workflowservice.RespondWorkflowTaskCompletedRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskToken: resp3.WorkflowTask.GetTaskToken(), Commands: []*commandpb.Command{ { @@ -311,7 +311,7 @@ func (s *WorkflowTaskTestSuite) TestWorkflowTaskHeartbeatingWithLocalActivitiesR s.NoError(err4) resp5, err5 := s.FrontendClient().RespondWorkflowTaskCompleted(testcore.NewContext(), &workflowservice.RespondWorkflowTaskCompletedRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskToken: resp4.WorkflowTask.GetTaskToken(), Commands: []*commandpb.Command{ { @@ -331,7 +331,7 @@ func (s *WorkflowTaskTestSuite) TestWorkflowTaskHeartbeatingWithLocalActivitiesR s.NoError(err5) s.Nil(resp5.WorkflowTask) - historyEvents := s.GetHistory(s.Namespace(), we) + historyEvents := s.GetHistory(s.Namespace().String(), we) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted 2 WorkflowTaskScheduled @@ -363,7 +363,7 @@ func (s *WorkflowTaskTestSuite) TestWorkflowTerminationSignalBeforeRegularWorkfl request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -383,10 +383,10 @@ func (s *WorkflowTaskTestSuite) TestWorkflowTerminationSignalBeforeRegularWorkfl s.EqualHistoryEvents(` 1 WorkflowExecutionStarted - 2 WorkflowTaskScheduled`, s.GetHistory(s.Namespace(), we)) + 2 WorkflowTaskScheduled`, s.GetHistory(s.Namespace().String(), we)) _, err0 = s.FrontendClient().SignalWorkflowExecution(testcore.NewContext(), &workflowservice.SignalWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: we, SignalName: "sig-for-integ-test", Input: payloads.EncodeString(""), @@ -397,11 +397,11 @@ func (s *WorkflowTaskTestSuite) TestWorkflowTerminationSignalBeforeRegularWorkfl s.EqualHistoryEvents(` 1 WorkflowExecutionStarted 2 WorkflowTaskScheduled - 3 WorkflowExecutionSignaled`, s.GetHistory(s.Namespace(), we)) + 3 WorkflowExecutionSignaled`, s.GetHistory(s.Namespace().String(), we)) // start this transient workflow task, the attempt should be cleared and it becomes again a regular workflow task resp1, err1 := s.FrontendClient().PollWorkflowTaskQueue(testcore.NewContext(), &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: identity, }) @@ -412,11 +412,11 @@ func (s *WorkflowTaskTestSuite) TestWorkflowTerminationSignalBeforeRegularWorkfl 1 WorkflowExecutionStarted 2 WorkflowTaskScheduled 3 WorkflowExecutionSignaled - 4 WorkflowTaskStarted`, s.GetHistory(s.Namespace(), we)) + 4 WorkflowTaskStarted`, s.GetHistory(s.Namespace().String(), we)) // then terminate the workflow _, err := s.FrontendClient().TerminateWorkflowExecution(testcore.NewContext(), &workflowservice.TerminateWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: we, Reason: "test-reason", }) @@ -428,7 +428,7 @@ func (s *WorkflowTaskTestSuite) TestWorkflowTerminationSignalBeforeRegularWorkfl 3 WorkflowExecutionSignaled 4 WorkflowTaskStarted 5 WorkflowTaskFailed - 6 WorkflowExecutionTerminated`, s.GetHistory(s.Namespace(), we)) + 6 WorkflowExecutionTerminated`, s.GetHistory(s.Namespace().String(), we)) } func (s *WorkflowTaskTestSuite) TestWorkflowTerminationSignalAfterRegularWorkflowTaskStarted() { @@ -443,7 +443,7 @@ func (s *WorkflowTaskTestSuite) TestWorkflowTerminationSignalAfterRegularWorkflo request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -463,11 +463,11 @@ func (s *WorkflowTaskTestSuite) TestWorkflowTerminationSignalAfterRegularWorkflo s.EqualHistoryEvents(` 1 WorkflowExecutionStarted - 2 WorkflowTaskScheduled`, s.GetHistory(s.Namespace(), we)) + 2 WorkflowTaskScheduled`, s.GetHistory(s.Namespace().String(), we)) // start workflow task to make signals into bufferedEvents _, err1 := s.FrontendClient().PollWorkflowTaskQueue(testcore.NewContext(), &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: identity, }) @@ -476,11 +476,11 @@ func (s *WorkflowTaskTestSuite) TestWorkflowTerminationSignalAfterRegularWorkflo s.EqualHistoryEvents(` 1 WorkflowExecutionStarted 2 WorkflowTaskScheduled - 3 WorkflowTaskStarted`, s.GetHistory(s.Namespace(), we)) + 3 WorkflowTaskStarted`, s.GetHistory(s.Namespace().String(), we)) // this signal should be buffered _, err0 = s.FrontendClient().SignalWorkflowExecution(testcore.NewContext(), &workflowservice.SignalWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: we, SignalName: "sig-for-integ-test", Input: payloads.EncodeString(""), @@ -491,17 +491,17 @@ func (s *WorkflowTaskTestSuite) TestWorkflowTerminationSignalAfterRegularWorkflo s.EqualHistoryEvents(` 1 WorkflowExecutionStarted 2 WorkflowTaskScheduled - 3 WorkflowTaskStarted`, s.GetHistory(s.Namespace(), we)) + 3 WorkflowTaskStarted`, s.GetHistory(s.Namespace().String(), we)) // then terminate the workflow _, err := s.FrontendClient().TerminateWorkflowExecution(testcore.NewContext(), &workflowservice.TerminateWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: we, Reason: "test-reason", }) s.NoError(err) - historyEvents := s.GetHistory(s.Namespace(), we) + historyEvents := s.GetHistory(s.Namespace().String(), we) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted 2 WorkflowTaskScheduled @@ -523,7 +523,7 @@ func (s *WorkflowTaskTestSuite) TestWorkflowTerminationSignalAfterRegularWorkflo request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -543,13 +543,13 @@ func (s *WorkflowTaskTestSuite) TestWorkflowTerminationSignalAfterRegularWorkflo s.EqualHistoryEvents(` 1 WorkflowExecutionStarted - 2 WorkflowTaskScheduled`, s.GetHistory(s.Namespace(), we)) + 2 WorkflowTaskScheduled`, s.GetHistory(s.Namespace().String(), we)) cause := enumspb.WORKFLOW_TASK_FAILED_CAUSE_WORKFLOW_WORKER_UNHANDLED_FAILURE // start workflow task to make signals into bufferedEvents resp1, err1 := s.FrontendClient().PollWorkflowTaskQueue(testcore.NewContext(), &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: identity, }) @@ -558,11 +558,11 @@ func (s *WorkflowTaskTestSuite) TestWorkflowTerminationSignalAfterRegularWorkflo s.EqualHistoryEvents(` 1 WorkflowExecutionStarted 2 WorkflowTaskScheduled - 3 WorkflowTaskStarted`, s.GetHistory(s.Namespace(), we)) + 3 WorkflowTaskStarted`, s.GetHistory(s.Namespace().String(), we)) // this signal should be buffered _, err0 = s.FrontendClient().SignalWorkflowExecution(testcore.NewContext(), &workflowservice.SignalWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: we, SignalName: "sig-for-integ-test", Input: payloads.EncodeString(""), @@ -573,11 +573,11 @@ func (s *WorkflowTaskTestSuite) TestWorkflowTerminationSignalAfterRegularWorkflo s.EqualHistoryEvents(` 1 WorkflowExecutionStarted 2 WorkflowTaskScheduled - 3 WorkflowTaskStarted`, s.GetHistory(s.Namespace(), we)) + 3 WorkflowTaskStarted`, s.GetHistory(s.Namespace().String(), we)) // fail this workflow task to flush buffer, and then another workflow task will be scheduled _, err2 := s.FrontendClient().RespondWorkflowTaskFailed(testcore.NewContext(), &workflowservice.RespondWorkflowTaskFailedRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskToken: resp1.GetTaskToken(), Cause: cause, Identity: "integ test", @@ -589,11 +589,11 @@ func (s *WorkflowTaskTestSuite) TestWorkflowTerminationSignalAfterRegularWorkflo 3 WorkflowTaskStarted 4 WorkflowTaskFailed 5 WorkflowExecutionSignaled - 6 WorkflowTaskScheduled`, s.GetHistory(s.Namespace(), we)) + 6 WorkflowTaskScheduled`, s.GetHistory(s.Namespace().String(), we)) // then terminate the workflow _, err := s.FrontendClient().TerminateWorkflowExecution(testcore.NewContext(), &workflowservice.TerminateWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: we, Reason: "test-reason", }) @@ -606,7 +606,7 @@ func (s *WorkflowTaskTestSuite) TestWorkflowTerminationSignalAfterRegularWorkflo 4 WorkflowTaskFailed 5 WorkflowExecutionSignaled 6 WorkflowTaskScheduled - 7 WorkflowExecutionTerminated`, s.GetHistory(s.Namespace(), we)) + 7 WorkflowExecutionTerminated`, s.GetHistory(s.Namespace().String(), we)) } func (s *WorkflowTaskTestSuite) TestWorkflowTerminationSignalBeforeTransientWorkflowTaskStarted() { @@ -621,7 +621,7 @@ func (s *WorkflowTaskTestSuite) TestWorkflowTerminationSignalBeforeTransientWork request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -641,12 +641,12 @@ func (s *WorkflowTaskTestSuite) TestWorkflowTerminationSignalBeforeTransientWork s.EqualHistoryEvents(` 1 WorkflowExecutionStarted - 2 WorkflowTaskScheduled`, s.GetHistory(s.Namespace(), we)) + 2 WorkflowTaskScheduled`, s.GetHistory(s.Namespace().String(), we)) cause := enumspb.WORKFLOW_TASK_FAILED_CAUSE_WORKFLOW_WORKER_UNHANDLED_FAILURE for i := 0; i < 10; i++ { resp1, err1 := s.FrontendClient().PollWorkflowTaskQueue(testcore.NewContext(), &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: identity, }) @@ -661,7 +661,7 @@ func (s *WorkflowTaskTestSuite) TestWorkflowTerminationSignalBeforeTransientWork } _, err2 := s.FrontendClient().RespondWorkflowTaskFailed(testcore.NewContext(), &workflowservice.RespondWorkflowTaskFailedRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskToken: resp1.GetTaskToken(), Cause: cause, Identity: "integ test", @@ -673,10 +673,10 @@ func (s *WorkflowTaskTestSuite) TestWorkflowTerminationSignalBeforeTransientWork 1 WorkflowExecutionStarted 2 WorkflowTaskScheduled 3 WorkflowTaskStarted - 4 WorkflowTaskFailed`, s.GetHistory(s.Namespace(), we)) + 4 WorkflowTaskFailed`, s.GetHistory(s.Namespace().String(), we)) _, err0 = s.FrontendClient().SignalWorkflowExecution(testcore.NewContext(), &workflowservice.SignalWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: we, SignalName: "sig-for-integ-test", Input: payloads.EncodeString(""), @@ -689,11 +689,11 @@ func (s *WorkflowTaskTestSuite) TestWorkflowTerminationSignalBeforeTransientWork 2 WorkflowTaskScheduled 3 WorkflowTaskStarted 4 WorkflowTaskFailed - 5 WorkflowExecutionSignaled`, s.GetHistory(s.Namespace(), we)) + 5 WorkflowExecutionSignaled`, s.GetHistory(s.Namespace().String(), we)) // start this transient workflow task, the attempt should be cleared and it becomes again a regular workflow task resp1, err1 := s.FrontendClient().PollWorkflowTaskQueue(testcore.NewContext(), &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: identity, }) @@ -707,11 +707,11 @@ func (s *WorkflowTaskTestSuite) TestWorkflowTerminationSignalBeforeTransientWork 4 WorkflowTaskFailed 5 WorkflowExecutionSignaled 6 WorkflowTaskScheduled - 7 WorkflowTaskStarted`, s.GetHistory(s.Namespace(), we)) + 7 WorkflowTaskStarted`, s.GetHistory(s.Namespace().String(), we)) // then terminate the workflow _, err := s.FrontendClient().TerminateWorkflowExecution(testcore.NewContext(), &workflowservice.TerminateWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: we, Reason: "test-reason", }) @@ -726,7 +726,7 @@ func (s *WorkflowTaskTestSuite) TestWorkflowTerminationSignalBeforeTransientWork 6 WorkflowTaskScheduled 7 WorkflowTaskStarted 8 WorkflowTaskFailed - 9 WorkflowExecutionTerminated`, s.GetHistory(s.Namespace(), we)) + 9 WorkflowExecutionTerminated`, s.GetHistory(s.Namespace().String(), we)) } func (s *WorkflowTaskTestSuite) TestWorkflowTerminationSignalAfterTransientWorkflowTaskStarted() { @@ -741,7 +741,7 @@ func (s *WorkflowTaskTestSuite) TestWorkflowTerminationSignalAfterTransientWorkf request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -761,12 +761,12 @@ func (s *WorkflowTaskTestSuite) TestWorkflowTerminationSignalAfterTransientWorkf s.EqualHistoryEvents(` 1 WorkflowExecutionStarted - 2 WorkflowTaskScheduled`, s.GetHistory(s.Namespace(), we)) + 2 WorkflowTaskScheduled`, s.GetHistory(s.Namespace().String(), we)) cause := enumspb.WORKFLOW_TASK_FAILED_CAUSE_WORKFLOW_WORKER_UNHANDLED_FAILURE for i := 0; i < 10; i++ { resp1, err1 := s.FrontendClient().PollWorkflowTaskQueue(testcore.NewContext(), &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: identity, }) @@ -781,7 +781,7 @@ func (s *WorkflowTaskTestSuite) TestWorkflowTerminationSignalAfterTransientWorkf } _, err2 := s.FrontendClient().RespondWorkflowTaskFailed(testcore.NewContext(), &workflowservice.RespondWorkflowTaskFailedRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskToken: resp1.GetTaskToken(), Cause: cause, Identity: "integ test", @@ -793,11 +793,11 @@ func (s *WorkflowTaskTestSuite) TestWorkflowTerminationSignalAfterTransientWorkf 1 WorkflowExecutionStarted 2 WorkflowTaskScheduled 3 WorkflowTaskStarted - 4 WorkflowTaskFailed`, s.GetHistory(s.Namespace(), we)) + 4 WorkflowTaskFailed`, s.GetHistory(s.Namespace().String(), we)) // start workflow task to make signals into bufferedEvents _, err1 := s.FrontendClient().PollWorkflowTaskQueue(testcore.NewContext(), &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: identity, }) @@ -807,11 +807,11 @@ func (s *WorkflowTaskTestSuite) TestWorkflowTerminationSignalAfterTransientWorkf 1 WorkflowExecutionStarted 2 WorkflowTaskScheduled 3 WorkflowTaskStarted - 4 WorkflowTaskFailed`, s.GetHistory(s.Namespace(), we)) + 4 WorkflowTaskFailed`, s.GetHistory(s.Namespace().String(), we)) // this signal should be buffered _, err0 = s.FrontendClient().SignalWorkflowExecution(testcore.NewContext(), &workflowservice.SignalWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: we, SignalName: "sig-for-integ-test", Input: payloads.EncodeString(""), @@ -823,11 +823,11 @@ func (s *WorkflowTaskTestSuite) TestWorkflowTerminationSignalAfterTransientWorkf 1 WorkflowExecutionStarted 2 WorkflowTaskScheduled 3 WorkflowTaskStarted - 4 WorkflowTaskFailed`, s.GetHistory(s.Namespace(), we)) + 4 WorkflowTaskFailed`, s.GetHistory(s.Namespace().String(), we)) // then terminate the workflow _, err := s.FrontendClient().TerminateWorkflowExecution(testcore.NewContext(), &workflowservice.TerminateWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: we, Reason: "test-reason", }) @@ -839,7 +839,7 @@ func (s *WorkflowTaskTestSuite) TestWorkflowTerminationSignalAfterTransientWorkf 3 WorkflowTaskStarted 4 WorkflowTaskFailed 5 WorkflowExecutionSignaled - 6 WorkflowExecutionTerminated`, s.GetHistory(s.Namespace(), we)) + 6 WorkflowExecutionTerminated`, s.GetHistory(s.Namespace().String(), we)) } func (s *WorkflowTaskTestSuite) TestWorkflowTerminationSignalAfterTransientWorkflowTaskStartedAndFailWorkflowTask() { @@ -854,7 +854,7 @@ func (s *WorkflowTaskTestSuite) TestWorkflowTerminationSignalAfterTransientWorkf request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: workflowType, TaskQueue: taskQueue, @@ -874,12 +874,12 @@ func (s *WorkflowTaskTestSuite) TestWorkflowTerminationSignalAfterTransientWorkf s.EqualHistoryEvents(` 1 WorkflowExecutionStarted - 2 WorkflowTaskScheduled`, s.GetHistory(s.Namespace(), we)) + 2 WorkflowTaskScheduled`, s.GetHistory(s.Namespace().String(), we)) cause := enumspb.WORKFLOW_TASK_FAILED_CAUSE_WORKFLOW_WORKER_UNHANDLED_FAILURE for i := 0; i < 10; i++ { resp1, err1 := s.FrontendClient().PollWorkflowTaskQueue(testcore.NewContext(), &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: identity, }) @@ -894,7 +894,7 @@ func (s *WorkflowTaskTestSuite) TestWorkflowTerminationSignalAfterTransientWorkf } _, err2 := s.FrontendClient().RespondWorkflowTaskFailed(testcore.NewContext(), &workflowservice.RespondWorkflowTaskFailedRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskToken: resp1.GetTaskToken(), Cause: cause, Identity: "integ test", @@ -906,11 +906,11 @@ func (s *WorkflowTaskTestSuite) TestWorkflowTerminationSignalAfterTransientWorkf 1 WorkflowExecutionStarted 2 WorkflowTaskScheduled 3 WorkflowTaskStarted - 4 WorkflowTaskFailed`, s.GetHistory(s.Namespace(), we)) + 4 WorkflowTaskFailed`, s.GetHistory(s.Namespace().String(), we)) // start workflow task to make signals into bufferedEvents resp1, err1 := s.FrontendClient().PollWorkflowTaskQueue(testcore.NewContext(), &workflowservice.PollWorkflowTaskQueueRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: taskQueue, Identity: identity, }) @@ -920,11 +920,11 @@ func (s *WorkflowTaskTestSuite) TestWorkflowTerminationSignalAfterTransientWorkf 1 WorkflowExecutionStarted 2 WorkflowTaskScheduled 3 WorkflowTaskStarted - 4 WorkflowTaskFailed`, s.GetHistory(s.Namespace(), we)) + 4 WorkflowTaskFailed`, s.GetHistory(s.Namespace().String(), we)) // this signal should be buffered _, err0 = s.FrontendClient().SignalWorkflowExecution(testcore.NewContext(), &workflowservice.SignalWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: we, SignalName: "sig-for-integ-test", Input: payloads.EncodeString(""), @@ -936,11 +936,11 @@ func (s *WorkflowTaskTestSuite) TestWorkflowTerminationSignalAfterTransientWorkf 1 WorkflowExecutionStarted 2 WorkflowTaskScheduled 3 WorkflowTaskStarted - 4 WorkflowTaskFailed`, s.GetHistory(s.Namespace(), we)) + 4 WorkflowTaskFailed`, s.GetHistory(s.Namespace().String(), we)) // fail this workflow task to flush buffer _, err2 := s.FrontendClient().RespondWorkflowTaskFailed(testcore.NewContext(), &workflowservice.RespondWorkflowTaskFailedRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskToken: resp1.GetTaskToken(), Cause: cause, Identity: "integ test", @@ -952,11 +952,11 @@ func (s *WorkflowTaskTestSuite) TestWorkflowTerminationSignalAfterTransientWorkf 3 WorkflowTaskStarted 4 WorkflowTaskFailed 5 WorkflowExecutionSignaled - 6 WorkflowTaskScheduled`, s.GetHistory(s.Namespace(), we)) + 6 WorkflowTaskScheduled`, s.GetHistory(s.Namespace().String(), we)) // then terminate the workflow _, err := s.FrontendClient().TerminateWorkflowExecution(testcore.NewContext(), &workflowservice.TerminateWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: we, Reason: "test-reason", }) @@ -969,5 +969,5 @@ func (s *WorkflowTaskTestSuite) TestWorkflowTerminationSignalAfterTransientWorkf 4 WorkflowTaskFailed 5 WorkflowExecutionSignaled 6 WorkflowTaskScheduled - 7 WorkflowExecutionTerminated`, s.GetHistory(s.Namespace(), we)) + 7 WorkflowExecutionTerminated`, s.GetHistory(s.Namespace().String(), we)) } diff --git a/tests/workflow_test.go b/tests/workflow_test.go index d64b6ecae30..9dc2b2e2924 100644 --- a/tests/workflow_test.go +++ b/tests/workflow_test.go @@ -71,7 +71,7 @@ func (s *WorkflowTestSuite) TestStartWorkflowExecution() { makeRequest := func() *workflowservice.StartWorkflowExecutionRequest { return &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: testcore.RandomizeStr(s.T().Name()), WorkflowType: &commonpb.WorkflowType{Name: wt}, TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, @@ -88,7 +88,7 @@ func (s *WorkflowTestSuite) TestStartWorkflowExecution() { s.True(we.Started) // Validate the default value for WorkflowTaskTimeoutSeconds - historyEvents := s.GetHistory(s.Namespace(), &commonpb.WorkflowExecution{ + historyEvents := s.GetHistory(s.Namespace().String(), &commonpb.WorkflowExecution{ WorkflowId: request.WorkflowId, RunId: we.RunId, }) @@ -155,7 +155,7 @@ func (s *WorkflowTestSuite) TestStartWorkflowExecution_Terminate() { request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: &commonpb.WorkflowType{Name: "functional-start-workflow-terminate-test-type"}, TaskQueue: &taskqueuepb.TaskQueue{Name: "functional-start-workflow-terminate-test-taskqueue", Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, @@ -175,7 +175,7 @@ func (s *WorkflowTestSuite) TestStartWorkflowExecution_Terminate() { s.NotEqual(we0.RunId, we1.RunId) descResp, err := s.FrontendClient().DescribeWorkflowExecution(testcore.NewContext(), &workflowservice.DescribeWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: &commonpb.WorkflowExecution{ WorkflowId: id, RunId: we0.RunId, @@ -185,7 +185,7 @@ func (s *WorkflowTestSuite) TestStartWorkflowExecution_Terminate() { s.Equal(enumspb.WORKFLOW_EXECUTION_STATUS_TERMINATED, descResp.WorkflowExecutionInfo.Status) descResp, err = s.FrontendClient().DescribeWorkflowExecution(testcore.NewContext(), &workflowservice.DescribeWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: &commonpb.WorkflowExecution{ WorkflowId: id, RunId: we1.RunId, @@ -208,7 +208,7 @@ func (s *WorkflowTestSuite) TestStartWorkflowExecutionWithDelay() { request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: &commonpb.WorkflowType{Name: wt}, TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, @@ -235,7 +235,7 @@ func (s *WorkflowTestSuite) TestStartWorkflowExecutionWithDelay() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, StickyTaskQueue: &taskqueuepb.TaskQueue{Name: stickyTq, Kind: enumspb.TASK_QUEUE_KIND_STICKY, NormalName: tl}, Identity: identity, @@ -249,7 +249,7 @@ func (s *WorkflowTestSuite) TestStartWorkflowExecutionWithDelay() { s.GreaterOrEqual(delayEndTime.Sub(reqStartTime), startDelay) descResp, descErr := s.FrontendClient().DescribeWorkflowExecution(testcore.NewContext(), &workflowservice.DescribeWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: &commonpb.WorkflowExecution{ WorkflowId: id, RunId: we0.RunId, @@ -268,7 +268,7 @@ func (s *WorkflowTestSuite) TestTerminateWorkflow() { request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: &commonpb.WorkflowType{Name: wt}, TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, @@ -321,7 +321,7 @@ func (s *WorkflowTestSuite) TestTerminateWorkflow() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{Name: tl}, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -335,7 +335,7 @@ func (s *WorkflowTestSuite) TestTerminateWorkflow() { s.NoError(err) _, err = s.FrontendClient().TerminateWorkflowExecution(testcore.NewContext(), &workflowservice.TerminateWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowExecution: &commonpb.WorkflowExecution{ WorkflowId: id, RunId: we.RunId, @@ -349,7 +349,7 @@ func (s *WorkflowTestSuite) TestTerminateWorkflow() { var historyEvents []*historypb.HistoryEvent GetHistoryLoop: for i := 0; i < 10; i++ { - historyEvents = s.GetHistory(s.Namespace(), &commonpb.WorkflowExecution{ + historyEvents = s.GetHistory(s.Namespace().String(), &commonpb.WorkflowExecution{ WorkflowId: id, RunId: we.RunId, }) @@ -376,7 +376,7 @@ StartNewExecutionLoop: for i := 0; i < 10; i++ { request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: &commonpb.WorkflowType{Name: wt}, TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, @@ -411,7 +411,7 @@ func (s *WorkflowTestSuite) TestSequentialWorkflow() { request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: &commonpb.WorkflowType{Name: wt}, TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, @@ -473,7 +473,7 @@ func (s *WorkflowTestSuite) TestSequentialWorkflow() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -509,7 +509,7 @@ func (s *WorkflowTestSuite) TestCompleteWorkflowTaskAndCreateNewOne() { request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: &commonpb.WorkflowType{Name: wt}, TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, @@ -547,7 +547,7 @@ func (s *WorkflowTestSuite) TestCompleteWorkflowTaskAndCreateNewOne() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -579,7 +579,7 @@ func (s *WorkflowTestSuite) TestWorkflowTaskAndActivityTaskTimeoutsWorkflow() { request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: &commonpb.WorkflowType{Name: wt}, TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, @@ -639,7 +639,7 @@ func (s *WorkflowTestSuite) TestWorkflowTaskAndActivityTaskTimeoutsWorkflow() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -658,7 +658,7 @@ func (s *WorkflowTestSuite) TestWorkflowTaskAndActivityTaskTimeoutsWorkflow() { _, err = poller.PollAndProcessWorkflowTask(testcore.WithDumpHistory, testcore.WithExpectedAttemptCount(2)) } if err != nil { - s.PrintHistoryEventsCompact(s.GetHistory(s.Namespace(), &commonpb.WorkflowExecution{ + s.PrintHistoryEventsCompact(s.GetHistory(s.Namespace().String(), &commonpb.WorkflowExecution{ WorkflowId: id, RunId: we.RunId, })) @@ -690,7 +690,7 @@ func (s *WorkflowTestSuite) TestWorkflowRetry() { maximumAttempts := 5 request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: &commonpb.WorkflowType{Name: wt}, TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, @@ -739,7 +739,7 @@ func (s *WorkflowTestSuite) TestWorkflowRetry() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -749,7 +749,7 @@ func (s *WorkflowTestSuite) TestWorkflowRetry() { describeWorkflowExecution := func(execution *commonpb.WorkflowExecution) (*workflowservice.DescribeWorkflowExecutionResponse, error) { return s.FrontendClient().DescribeWorkflowExecution(testcore.NewContext(), &workflowservice.DescribeWorkflowExecutionRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: execution, }) } @@ -757,7 +757,7 @@ func (s *WorkflowTestSuite) TestWorkflowRetry() { for i := 1; i <= maximumAttempts; i++ { _, err := poller.PollAndProcessWorkflowTask() s.NoError(err) - events := s.GetHistory(s.Namespace(), executions[i-1]) + events := s.GetHistory(s.Namespace().String(), executions[i-1]) if i == maximumAttempts { s.EqualHistoryEvents(fmt.Sprintf(` 1 WorkflowExecutionStarted {"Attempt":%d} @@ -791,7 +791,7 @@ func (s *WorkflowTestSuite) TestWorkflowRetry() { // Check run id links for i := 0; i < maximumAttempts; i++ { - events := s.GetHistory(s.Namespace(), executions[i]) + events := s.GetHistory(s.Namespace().String(), executions[i]) if i == 0 { s.EqualHistoryEvents(fmt.Sprintf(` 1 WorkflowExecutionStarted {"ContinuedExecutionRunId":""} @@ -821,7 +821,7 @@ func (s *WorkflowTestSuite) TestWorkflowRetry() { ctx, cancel := context.WithTimeout(context.Background(), 90*time.Second) oldSDKCtx := headers.SetVersionsForTests(ctx, "1.3.1", headers.ClientNameJavaSDK, headers.SupportedServerVersions, "") resp, err := s.FrontendClient().GetWorkflowExecutionHistory(oldSDKCtx, &workflowservice.GetWorkflowExecutionHistoryRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), Execution: executions[i], MaximumPageSize: 5, HistoryEventFilterType: enumspb.HISTORY_EVENT_FILTER_TYPE_CLOSE_EVENT, @@ -876,7 +876,7 @@ func (s *WorkflowTestSuite) TestWorkflowRetryFailures() { // Fail using attempt request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: &commonpb.WorkflowType{Name: wt}, TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, @@ -902,7 +902,7 @@ func (s *WorkflowTestSuite) TestWorkflowRetryFailures() { wtHandler := workflowImpl(5, "retryable-error", false, &executions) poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -912,7 +912,7 @@ func (s *WorkflowTestSuite) TestWorkflowRetryFailures() { _, err := poller.PollAndProcessWorkflowTask() s.NoError(err) - events := s.GetHistory(s.Namespace(), executions[0]) + events := s.GetHistory(s.Namespace().String(), executions[0]) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted {"Attempt":1} 2 WorkflowTaskScheduled @@ -922,7 +922,7 @@ func (s *WorkflowTestSuite) TestWorkflowRetryFailures() { _, err = poller.PollAndProcessWorkflowTask() s.NoError(err) - events = s.GetHistory(s.Namespace(), executions[1]) + events = s.GetHistory(s.Namespace().String(), executions[1]) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted {"Attempt":2} 2 WorkflowTaskScheduled @@ -932,7 +932,7 @@ func (s *WorkflowTestSuite) TestWorkflowRetryFailures() { _, err = poller.PollAndProcessWorkflowTask() s.NoError(err) - events = s.GetHistory(s.Namespace(), executions[2]) + events = s.GetHistory(s.Namespace().String(), executions[2]) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted {"Attempt":3} 2 WorkflowTaskScheduled @@ -943,7 +943,7 @@ func (s *WorkflowTestSuite) TestWorkflowRetryFailures() { // Fail error reason request = &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: &commonpb.WorkflowType{Name: wt}, TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, @@ -969,7 +969,7 @@ func (s *WorkflowTestSuite) TestWorkflowRetryFailures() { wtHandler = workflowImpl(5, "bad-bug", true, &executions) poller = &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -979,7 +979,7 @@ func (s *WorkflowTestSuite) TestWorkflowRetryFailures() { _, err = poller.PollAndProcessWorkflowTask() s.NoError(err) - events = s.GetHistory(s.Namespace(), executions[0]) + events = s.GetHistory(s.Namespace().String(), executions[0]) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted {"Attempt":1} 2 WorkflowTaskScheduled diff --git a/tests/workflow_timer_test.go b/tests/workflow_timer_test.go index d0c27187a30..527f8e010a9 100644 --- a/tests/workflow_timer_test.go +++ b/tests/workflow_timer_test.go @@ -58,7 +58,7 @@ func (s *WorkflowTimerTestSuite) TestCancelTimer() { request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: &commonpb.WorkflowType{Name: wt}, TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, @@ -92,7 +92,7 @@ func (s *WorkflowTimerTestSuite) TestCancelTimer() { }}, nil } - historyEvents := s.GetHistory(s.Namespace(), workflowExecution) + historyEvents := s.GetHistory(s.Namespace().String(), workflowExecution) for _, event := range historyEvents { switch event.GetEventType() { // nolint:exhaustive case enumspb.EVENT_TYPE_WORKFLOW_EXECUTION_SIGNALED: @@ -125,7 +125,7 @@ func (s *WorkflowTimerTestSuite) TestCancelTimer() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -139,20 +139,20 @@ func (s *WorkflowTimerTestSuite) TestCancelTimer() { s.Logger.Info("PollAndProcessWorkflowTask: completed") s.NoError(err) - s.Nil(s.SendSignal(s.Namespace(), workflowExecution, "random signal name", payloads.EncodeString("random signal payload"), identity)) + s.Nil(s.SendSignal(s.Namespace().String(), workflowExecution, "random signal name", payloads.EncodeString("random signal payload"), identity)) // receive the signal & cancel the timer _, err = poller.PollAndProcessWorkflowTask() s.Logger.Info("PollAndProcessWorkflowTask: completed") s.NoError(err) - s.Nil(s.SendSignal(s.Namespace(), workflowExecution, "random signal name", payloads.EncodeString("random signal payload"), identity)) + s.Nil(s.SendSignal(s.Namespace().String(), workflowExecution, "random signal name", payloads.EncodeString("random signal payload"), identity)) // complete the workflow _, err = poller.PollAndProcessWorkflowTask() s.Logger.Info("PollAndProcessWorkflowTask: completed") s.NoError(err) - historyEvents := s.GetHistory(s.Namespace(), workflowExecution) + historyEvents := s.GetHistory(s.Namespace().String(), workflowExecution) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted 2 WorkflowTaskScheduled @@ -180,7 +180,7 @@ func (s *WorkflowTimerTestSuite) TestCancelTimer_CancelFiredAndBuffered() { request := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id, WorkflowType: &commonpb.WorkflowType{Name: wt}, TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, @@ -214,7 +214,7 @@ func (s *WorkflowTimerTestSuite) TestCancelTimer_CancelFiredAndBuffered() { }}, nil } - historyEvents := s.GetHistory(s.Namespace(), workflowExecution) + historyEvents := s.GetHistory(s.Namespace().String(), workflowExecution) for _, event := range historyEvents { switch event.GetEventType() { // nolint:exhaustive case enumspb.EVENT_TYPE_WORKFLOW_EXECUTION_SIGNALED: @@ -248,7 +248,7 @@ func (s *WorkflowTimerTestSuite) TestCancelTimer_CancelFiredAndBuffered() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -262,20 +262,20 @@ func (s *WorkflowTimerTestSuite) TestCancelTimer_CancelFiredAndBuffered() { s.Logger.Info("PollAndProcessWorkflowTask: completed") s.NoError(err) - s.Nil(s.SendSignal(s.Namespace(), workflowExecution, "random signal name", payloads.EncodeString("random signal payload"), identity)) + s.Nil(s.SendSignal(s.Namespace().String(), workflowExecution, "random signal name", payloads.EncodeString("random signal payload"), identity)) // receive the signal & cancel the timer _, err = poller.PollAndProcessWorkflowTask() s.Logger.Info("PollAndProcessWorkflowTask: completed") s.NoError(err) - s.Nil(s.SendSignal(s.Namespace(), workflowExecution, "random signal name", payloads.EncodeString("random signal payload"), identity)) + s.Nil(s.SendSignal(s.Namespace().String(), workflowExecution, "random signal name", payloads.EncodeString("random signal payload"), identity)) // complete the workflow _, err = poller.PollAndProcessWorkflowTask() s.Logger.Info("PollAndProcessWorkflowTask: completed") s.NoError(err) - historyEvents := s.GetHistory(s.Namespace(), workflowExecution) + historyEvents := s.GetHistory(s.Namespace().String(), workflowExecution) s.EqualHistoryEvents(` 1 WorkflowExecutionStarted 2 WorkflowTaskScheduled diff --git a/tests/workflow_visibility_test.go b/tests/workflow_visibility_test.go index b041dafc23e..869609c95b2 100644 --- a/tests/workflow_visibility_test.go +++ b/tests/workflow_visibility_test.go @@ -63,7 +63,7 @@ func (s *WorkflowVisibilityTestSuite) TestVisibility() { startRequest := &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id1, WorkflowType: &commonpb.WorkflowType{Name: wt}, TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, @@ -88,7 +88,7 @@ func (s *WorkflowVisibilityTestSuite) TestVisibility() { poller := &testcore.TaskPoller{ Client: s.FrontendClient(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, Identity: identity, WorkflowTaskHandler: wtHandler, @@ -124,7 +124,7 @@ func (s *WorkflowVisibilityTestSuite) TestVisibility() { startRequest = &workflowservice.StartWorkflowExecutionRequest{ RequestId: uuid.New(), - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), WorkflowId: id2, WorkflowType: &commonpb.WorkflowType{Name: wt}, TaskQueue: &taskqueuepb.TaskQueue{Name: tl, Kind: enumspb.TASK_QUEUE_KIND_NORMAL}, @@ -148,7 +148,7 @@ func (s *WorkflowVisibilityTestSuite) TestVisibility() { s.Eventually( func() bool { resp, err3 := s.FrontendClient().ListClosedWorkflowExecutions(testcore.NewContext(), &workflowservice.ListClosedWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), MaximumPageSize: 100, StartTimeFilter: startFilter, Filters: &workflowservice.ListClosedWorkflowExecutionsRequest_TypeFilter{ @@ -176,7 +176,7 @@ func (s *WorkflowVisibilityTestSuite) TestVisibility() { s.Eventually( func() bool { resp, err4 := s.FrontendClient().ListOpenWorkflowExecutions(testcore.NewContext(), &workflowservice.ListOpenWorkflowExecutionsRequest{ - Namespace: s.Namespace(), + Namespace: s.Namespace().String(), MaximumPageSize: 100, StartTimeFilter: startFilter, Filters: &workflowservice.ListOpenWorkflowExecutionsRequest_TypeFilter{