@@ -55,11 +55,13 @@ func (s *activityTestSuite) TearDownTest() {
5555}
5656
5757// this is the mock for yarpcCallOptions, make sure length are the same
58- var callOptions = []interface {}{gomock .Any (), gomock .Any (), gomock .Any ()}
58+ var callOptions = []interface {}{gomock .Any (), gomock .Any (), gomock .Any (), gomock .Any ()}
59+
60+ var featureFlags = FeatureFlags {}
5961
6062func (s * activityTestSuite ) TestActivityHeartbeat () {
6163 ctx , cancel := context .WithCancel (context .Background ())
62- invoker := newServiceInvoker ([]byte ("task-token" ), "identity" , s .service , cancel , 1 , make (chan struct {}))
64+ invoker := newServiceInvoker ([]byte ("task-token" ), "identity" , s .service , cancel , 1 , make (chan struct {}), featureFlags )
6365 ctx = context .WithValue (ctx , activityEnvContextKey , & activityEnvironment {serviceInvoker : invoker })
6466
6567 s .service .EXPECT ().RecordActivityTaskHeartbeat (gomock .Any (), gomock .Any (), callOptions ... ).
@@ -70,7 +72,7 @@ func (s *activityTestSuite) TestActivityHeartbeat() {
7072
7173func (s * activityTestSuite ) TestActivityHeartbeat_InternalError () {
7274 ctx , cancel := context .WithCancel (context .Background ())
73- invoker := newServiceInvoker ([]byte ("task-token" ), "identity" , s .service , cancel , 1 , make (chan struct {}))
75+ invoker := newServiceInvoker ([]byte ("task-token" ), "identity" , s .service , cancel , 1 , make (chan struct {}), featureFlags )
7476 ctx = context .WithValue (ctx , activityEnvContextKey , & activityEnvironment {
7577 serviceInvoker : invoker ,
7678 logger : getTestLogger (s .T ())})
@@ -86,7 +88,7 @@ func (s *activityTestSuite) TestActivityHeartbeat_InternalError() {
8688
8789func (s * activityTestSuite ) TestActivityHeartbeat_CancelRequested () {
8890 ctx , cancel := context .WithCancel (context .Background ())
89- invoker := newServiceInvoker ([]byte ("task-token" ), "identity" , s .service , cancel , 1 , make (chan struct {}))
91+ invoker := newServiceInvoker ([]byte ("task-token" ), "identity" , s .service , cancel , 1 , make (chan struct {}), featureFlags )
9092 ctx = context .WithValue (ctx , activityEnvContextKey , & activityEnvironment {
9193 serviceInvoker : invoker ,
9294 logger : getTestLogger (s .T ())})
@@ -101,7 +103,7 @@ func (s *activityTestSuite) TestActivityHeartbeat_CancelRequested() {
101103
102104func (s * activityTestSuite ) TestActivityHeartbeat_EntityNotExist () {
103105 ctx , cancel := context .WithCancel (context .Background ())
104- invoker := newServiceInvoker ([]byte ("task-token" ), "identity" , s .service , cancel , 1 , make (chan struct {}))
106+ invoker := newServiceInvoker ([]byte ("task-token" ), "identity" , s .service , cancel , 1 , make (chan struct {}), featureFlags )
105107 ctx = context .WithValue (ctx , activityEnvContextKey , & activityEnvironment {
106108 serviceInvoker : invoker ,
107109 logger : getTestLogger (s .T ())})
@@ -116,7 +118,7 @@ func (s *activityTestSuite) TestActivityHeartbeat_EntityNotExist() {
116118
117119func (s * activityTestSuite ) TestActivityHeartbeat_SuppressContinousInvokes () {
118120 ctx , cancel := context .WithCancel (context .Background ())
119- invoker := newServiceInvoker ([]byte ("task-token" ), "identity" , s .service , cancel , 2 , make (chan struct {}))
121+ invoker := newServiceInvoker ([]byte ("task-token" ), "identity" , s .service , cancel , 2 , make (chan struct {}), featureFlags )
120122 ctx = context .WithValue (ctx , activityEnvContextKey , & activityEnvironment {
121123 serviceInvoker : invoker ,
122124 logger : getTestLogger (s .T ())})
@@ -131,7 +133,7 @@ func (s *activityTestSuite) TestActivityHeartbeat_SuppressContinousInvokes() {
131133
132134 // No HB timeout configured.
133135 service2 := workflowservicetest .NewMockClient (s .mockCtrl )
134- invoker2 := newServiceInvoker ([]byte ("task-token" ), "identity" , service2 , cancel , 0 , make (chan struct {}))
136+ invoker2 := newServiceInvoker ([]byte ("task-token" ), "identity" , service2 , cancel , 0 , make (chan struct {}), featureFlags )
135137 ctx = context .WithValue (ctx , activityEnvContextKey , & activityEnvironment {
136138 serviceInvoker : invoker2 ,
137139 logger : getTestLogger (s .T ())})
@@ -144,7 +146,7 @@ func (s *activityTestSuite) TestActivityHeartbeat_SuppressContinousInvokes() {
144146 // simulate batch picks before expiry.
145147 waitCh := make (chan struct {})
146148 service3 := workflowservicetest .NewMockClient (s .mockCtrl )
147- invoker3 := newServiceInvoker ([]byte ("task-token" ), "identity" , service3 , cancel , 2 , make (chan struct {}))
149+ invoker3 := newServiceInvoker ([]byte ("task-token" ), "identity" , service3 , cancel , 2 , make (chan struct {}), featureFlags )
148150 ctx = context .WithValue (ctx , activityEnvContextKey , & activityEnvironment {
149151 serviceInvoker : invoker3 ,
150152 logger : getTestLogger (s .T ())})
@@ -174,7 +176,7 @@ func (s *activityTestSuite) TestActivityHeartbeat_SuppressContinousInvokes() {
174176 // simulate batch picks before expiry, with out any progress specified.
175177 waitCh2 := make (chan struct {})
176178 service4 := workflowservicetest .NewMockClient (s .mockCtrl )
177- invoker4 := newServiceInvoker ([]byte ("task-token" ), "identity" , service4 , cancel , 2 , make (chan struct {}))
179+ invoker4 := newServiceInvoker ([]byte ("task-token" ), "identity" , service4 , cancel , 2 , make (chan struct {}), featureFlags )
178180 ctx = context .WithValue (ctx , activityEnvContextKey , & activityEnvironment {
179181 serviceInvoker : invoker4 ,
180182 logger : getTestLogger (s .T ())})
@@ -198,7 +200,7 @@ func (s *activityTestSuite) TestActivityHeartbeat_SuppressContinousInvokes() {
198200func (s * activityTestSuite ) TestActivityHeartbeat_WorkerStop () {
199201 ctx , cancel := context .WithCancel (context .Background ())
200202 workerStopChannel := make (chan struct {})
201- invoker := newServiceInvoker ([]byte ("task-token" ), "identity" , s .service , cancel , 5 , workerStopChannel )
203+ invoker := newServiceInvoker ([]byte ("task-token" ), "identity" , s .service , cancel , 5 , workerStopChannel , featureFlags )
202204 ctx = context .WithValue (ctx , activityEnvContextKey , & activityEnvironment {serviceInvoker : invoker })
203205
204206 heartBeatDetail := "testDetails"
0 commit comments