Skip to content

Commit

Permalink
Upgrade go to 1.11 (#589)
Browse files Browse the repository at this point in the history
  • Loading branch information
yiminc committed Oct 11, 2018
1 parent 190fa08 commit dca3f7d
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 54 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -5,7 +5,7 @@ language: go
directories:
- $HOME/.glide/cache
go:
- 1.10.x
- 1.11.x

go_import_path: go.uber.org/cadence
addons:
Expand Down
4 changes: 2 additions & 2 deletions evictiontest/workflow_cache_eviction_test.go
Expand Up @@ -105,8 +105,8 @@ func createTestEventWorkflowExecutionStarted(eventID int64, attr *m.WorkflowExec

func createTestEventDecisionTaskScheduled(eventID int64, attr *m.DecisionTaskScheduledEventAttributes) *m.HistoryEvent {
return &m.HistoryEvent{
EventId: common.Int64Ptr(eventID),
EventType: common.EventTypePtr(m.EventTypeDecisionTaskScheduled),
EventId: common.Int64Ptr(eventID),
EventType: common.EventTypePtr(m.EventTypeDecisionTaskScheduled),
DecisionTaskScheduledEventAttributes: attr}
}

Expand Down
26 changes: 13 additions & 13 deletions internal/internal_task_handlers.go
Expand Up @@ -310,14 +310,14 @@ func newWorkflowTaskHandler(
) WorkflowTaskHandler {
ensureRequiredParams(&params)
return &workflowTaskHandlerImpl{
domain: domain,
logger: params.Logger,
ppMgr: ppMgr,
metricsScope: metrics.NewTaggedScope(params.MetricsScope),
identity: params.Identity,
enableLoggingInReplay: params.EnableLoggingInReplay,
disableStickyExecution: params.DisableStickyExecution,
hostEnv: hostEnv,
domain: domain,
logger: params.Logger,
ppMgr: ppMgr,
metricsScope: metrics.NewTaggedScope(params.MetricsScope),
identity: params.Identity,
enableLoggingInReplay: params.EnableLoggingInReplay,
disableStickyExecution: params.DisableStickyExecution,
hostEnv: hostEnv,
nonDeterministicWorkflowPolicy: params.NonDeterministicWorkflowPolicy,
dataConverter: params.DataConverter,
}
Expand Down Expand Up @@ -501,8 +501,8 @@ func (wth *workflowTaskHandlerImpl) createWorkflowContext(task *s.PollForDecisio
},
ExecutionStartToCloseTimeoutSeconds: attributes.GetExecutionStartToCloseTimeoutSeconds(),
TaskStartToCloseTimeoutSeconds: attributes.GetTaskStartToCloseTimeoutSeconds(),
Domain: wth.domain,
Attempt: attributes.GetAttempt(),
Domain: wth.domain,
Attempt: attributes.GetAttempt(),
}

wfStartTime := time.Unix(0, h.Events[0].GetTimestamp())
Expand Down Expand Up @@ -1246,9 +1246,9 @@ func (wth *workflowTaskHandlerImpl) completeWorkflow(
metricsScope.Counter(metrics.WorkflowContinueAsNewCounter).Inc(1)
closeDecision = createNewDecision(s.DecisionTypeContinueAsNewWorkflowExecution)
closeDecision.ContinueAsNewWorkflowExecutionDecisionAttributes = &s.ContinueAsNewWorkflowExecutionDecisionAttributes{
WorkflowType: workflowTypePtr(*contErr.params.workflowType),
Input: contErr.params.input,
TaskList: common.TaskListPtr(s.TaskList{Name: contErr.params.taskListName}),
WorkflowType: workflowTypePtr(*contErr.params.workflowType),
Input: contErr.params.input,
TaskList: common.TaskListPtr(s.TaskList{Name: contErr.params.taskListName}),
ExecutionStartToCloseTimeoutSeconds: contErr.params.executionStartToCloseTimeoutSeconds,
TaskStartToCloseTimeoutSeconds: contErr.params.taskStartToCloseTimeoutSeconds,
}
Expand Down
28 changes: 14 additions & 14 deletions internal/internal_task_handlers_test.go
Expand Up @@ -83,8 +83,8 @@ func createTestEventWorkflowExecutionStarted(eventID int64, attr *s.WorkflowExec

func createTestEventActivityTaskScheduled(eventID int64, attr *s.ActivityTaskScheduledEventAttributes) *s.HistoryEvent {
return &s.HistoryEvent{
EventId: common.Int64Ptr(eventID),
EventType: common.EventTypePtr(s.EventTypeActivityTaskScheduled),
EventId: common.Int64Ptr(eventID),
EventType: common.EventTypePtr(s.EventTypeActivityTaskScheduled),
ActivityTaskScheduledEventAttributes: attr}
}

Expand All @@ -97,8 +97,8 @@ func createTestEventActivityTaskStarted(eventID int64, attr *s.ActivityTaskStart

func createTestEventActivityTaskCompleted(eventID int64, attr *s.ActivityTaskCompletedEventAttributes) *s.HistoryEvent {
return &s.HistoryEvent{
EventId: common.Int64Ptr(eventID),
EventType: common.EventTypePtr(s.EventTypeActivityTaskCompleted),
EventId: common.Int64Ptr(eventID),
EventType: common.EventTypePtr(s.EventTypeActivityTaskCompleted),
ActivityTaskCompletedEventAttributes: attr}
}

Expand All @@ -111,8 +111,8 @@ func createTestEventActivityTaskTimedOut(eventID int64, attr *s.ActivityTaskTime

func createTestEventDecisionTaskScheduled(eventID int64, attr *s.DecisionTaskScheduledEventAttributes) *s.HistoryEvent {
return &s.HistoryEvent{
EventId: common.Int64Ptr(eventID),
EventType: common.EventTypePtr(s.EventTypeDecisionTaskScheduled),
EventId: common.Int64Ptr(eventID),
EventType: common.EventTypePtr(s.EventTypeDecisionTaskScheduled),
DecisionTaskScheduledEventAttributes: attr}
}

Expand All @@ -135,8 +135,8 @@ func createTestEventWorkflowExecutionSignaled(eventID int64, signalName string)

func createTestEventDecisionTaskCompleted(eventID int64, attr *s.DecisionTaskCompletedEventAttributes) *s.HistoryEvent {
return &s.HistoryEvent{
EventId: common.Int64Ptr(eventID),
EventType: common.EventTypePtr(s.EventTypeDecisionTaskCompleted),
EventId: common.Int64Ptr(eventID),
EventType: common.EventTypePtr(s.EventTypeDecisionTaskCompleted),
DecisionTaskCompletedEventAttributes: attr}
}

Expand Down Expand Up @@ -383,9 +383,9 @@ func (t *TaskHandlersTestSuite) TestCacheEvictionWhenErrorOccurs() {
}),
}
params := workerExecutionParameters{
TaskList: taskList,
Identity: "test-id-1",
Logger: zap.NewNop(),
TaskList: taskList,
Identity: "test-id-1",
Logger: zap.NewNop(),
NonDeterministicWorkflowPolicy: NonDeterministicWorkflowPolicyBlockWorkflow,
}

Expand Down Expand Up @@ -421,9 +421,9 @@ func (t *TaskHandlersTestSuite) TestWorkflowTask_NondeterministicDetection() {
}
task := createWorkflowTask(testEvents, 3, "HelloWorld_Workflow")
params := workerExecutionParameters{
TaskList: taskList,
Identity: "test-id-1",
Logger: zap.NewNop(),
TaskList: taskList,
Identity: "test-id-1",
Logger: zap.NewNop(),
NonDeterministicWorkflowPolicy: NonDeterministicWorkflowPolicyBlockWorkflow,
}

Expand Down
4 changes: 2 additions & 2 deletions internal/internal_worker_interfaces_test.go
Expand Up @@ -127,7 +127,7 @@ func (s *InterfacesTestSuite) TestInterface() {
workflowExecutionParameters := workerExecutionParameters{
TaskList: "testTaskList",
ConcurrentPollRoutineSize: 4,
Logger: logger,
Logger: logger,
}

domainStatus := m.DomainStatusRegistered
Expand Down Expand Up @@ -156,7 +156,7 @@ func (s *InterfacesTestSuite) TestInterface() {
activityExecutionParameters := workerExecutionParameters{
TaskList: "testTaskList",
ConcurrentPollRoutineSize: 10,
Logger: logger,
Logger: logger,
}

// Register activity instances and launch the worker.
Expand Down
16 changes: 8 additions & 8 deletions internal/internal_workers_test.go
Expand Up @@ -73,7 +73,7 @@ func (s *WorkersTestSuite) TestWorkflowWorker() {
executionParameters := workerExecutionParameters{
TaskList: "testTaskList",
ConcurrentPollRoutineSize: 5,
Logger: logger,
Logger: logger,
}
overrides := &workerOverrides{workflowTaskHandler: newSampleWorkflowTaskHandler()}
workflowWorker := newWorkflowWorkerInternal(
Expand All @@ -94,7 +94,7 @@ func (s *WorkersTestSuite) TestActivityWorker() {
executionParameters := workerExecutionParameters{
TaskList: "testTaskList",
ConcurrentPollRoutineSize: 5,
Logger: logger,
Logger: logger,
}
overrides := &workerOverrides{activityTaskHandler: newSampleActivityTaskHandler()}
a := &greeterActivity{}
Expand All @@ -116,7 +116,7 @@ func (s *WorkersTestSuite) TestPollForDecisionTask_InternalServiceError() {
executionParameters := workerExecutionParameters{
TaskList: "testDecisionTaskList",
ConcurrentPollRoutineSize: 5,
Logger: zap.NewNop(),
Logger: zap.NewNop(),
}
overrides := &workerOverrides{workflowTaskHandler: newSampleWorkflowTaskHandler()}
workflowWorker := newWorkflowWorkerInternal(
Expand Down Expand Up @@ -165,7 +165,7 @@ func (s *WorkersTestSuite) TestLongRunningDecisionTask() {
EventId: common.Int64Ptr(1),
EventType: common.EventTypePtr(m.EventTypeWorkflowExecutionStarted),
WorkflowExecutionStartedEventAttributes: &m.WorkflowExecutionStartedEventAttributes{
TaskList: &m.TaskList{Name: &taskList},
TaskList: &m.TaskList{Name: &taskList},
ExecutionStartToCloseTimeoutSeconds: common.Int32Ptr(10),
TaskStartToCloseTimeoutSeconds: common.Int32Ptr(2),
WorkflowType: &m.WorkflowType{Name: common.StringPtr("long-running-decision-workflow-type")},
Expand All @@ -178,8 +178,8 @@ func (s *WorkersTestSuite) TestLongRunningDecisionTask() {
EventId: common.Int64Ptr(5),
EventType: common.EventTypePtr(m.EventTypeMarkerRecorded),
MarkerRecordedEventAttributes: &m.MarkerRecordedEventAttributes{
MarkerName: common.StringPtr(localActivityMarkerName),
Details: s.createLocalActivityMarkerDataForTest("0"),
MarkerName: common.StringPtr(localActivityMarkerName),
Details: s.createLocalActivityMarkerDataForTest("0"),
DecisionTaskCompletedEventId: common.Int64Ptr(4),
},
},
Expand All @@ -190,8 +190,8 @@ func (s *WorkersTestSuite) TestLongRunningDecisionTask() {
EventId: common.Int64Ptr(9),
EventType: common.EventTypePtr(m.EventTypeMarkerRecorded),
MarkerRecordedEventAttributes: &m.MarkerRecordedEventAttributes{
MarkerName: common.StringPtr(localActivityMarkerName),
Details: s.createLocalActivityMarkerDataForTest("1"),
MarkerName: common.StringPtr(localActivityMarkerName),
Details: s.createLocalActivityMarkerDataForTest("1"),
DecisionTaskCompletedEventId: common.Int64Ptr(8),
},
},
Expand Down
24 changes: 12 additions & 12 deletions internal/internal_workflow_client.go
Expand Up @@ -168,12 +168,12 @@ func (wc *workflowClient) StartWorkflow(
}

startRequest := &s.StartWorkflowExecutionRequest{
Domain: common.StringPtr(wc.domain),
RequestId: common.StringPtr(uuid.New()),
WorkflowId: common.StringPtr(workflowID),
WorkflowType: workflowTypePtr(*workflowType),
TaskList: common.TaskListPtr(s.TaskList{Name: common.StringPtr(options.TaskList)}),
Input: input,
Domain: common.StringPtr(wc.domain),
RequestId: common.StringPtr(uuid.New()),
WorkflowId: common.StringPtr(workflowID),
WorkflowType: workflowTypePtr(*workflowType),
TaskList: common.TaskListPtr(s.TaskList{Name: common.StringPtr(options.TaskList)}),
Input: input,
ExecutionStartToCloseTimeoutSeconds: common.Int32Ptr(executionTimeout),
TaskStartToCloseTimeoutSeconds: common.Int32Ptr(decisionTaskTimeout),
Identity: common.StringPtr(wc.identity),
Expand Down Expand Up @@ -317,12 +317,12 @@ func (wc *workflowClient) SignalWithStartWorkflow(ctx context.Context, workflowI
}

signalWithStartRequest := &s.SignalWithStartWorkflowExecutionRequest{
Domain: common.StringPtr(wc.domain),
RequestId: common.StringPtr(uuid.New()),
WorkflowId: common.StringPtr(workflowID),
WorkflowType: workflowTypePtr(*workflowType),
TaskList: common.TaskListPtr(s.TaskList{Name: common.StringPtr(options.TaskList)}),
Input: input,
Domain: common.StringPtr(wc.domain),
RequestId: common.StringPtr(uuid.New()),
WorkflowId: common.StringPtr(workflowID),
WorkflowType: workflowTypePtr(*workflowType),
TaskList: common.TaskListPtr(s.TaskList{Name: common.StringPtr(options.TaskList)}),
Input: input,
ExecutionStartToCloseTimeoutSeconds: common.Int32Ptr(executionTimeout),
TaskStartToCloseTimeoutSeconds: common.Int32Ptr(decisionTaskTimeout),
SignalName: common.StringPtr(signalName),
Expand Down
4 changes: 2 additions & 2 deletions internal/internal_workflow_testsuite_test.go
Expand Up @@ -1430,7 +1430,7 @@ func (s *WorkflowTestSuiteUnitTest) Test_SignalChildWorkflow() {
workflowFn := func(ctx Context) error {
cwo := ChildWorkflowOptions{
ExecutionStartToCloseTimeout: time.Minute,
Domain: "test-domain",
Domain: "test-domain",
}
ctx = WithChildWorkflowOptions(ctx, cwo)
childFuture := ExecuteChildWorkflow(ctx, childWorkflowFn, GetWorkflowInfo(ctx).WorkflowExecution)
Expand Down Expand Up @@ -1547,7 +1547,7 @@ func (s *WorkflowTestSuiteUnitTest) Test_CancelChildWorkflow() {
workflowFn := func(ctx Context) error {

cwo := ChildWorkflowOptions{
Domain: "test-domain",
Domain: "test-domain",
ExecutionStartToCloseTimeout: time.Minute,
}

Expand Down

0 comments on commit dca3f7d

Please sign in to comment.