@@ -226,7 +226,6 @@ func createDefaultInput() *commonpb.Payloads {
226226}
227227
228228func (s * standaloneActivityTestSuite ) Test_PollActivityExecution_NoWait () {
229- // Long poll for any state change. PollActivityTaskQueue is used to cause a state change.
230229 t := s .T ()
231230 ctx , cancel := context .WithTimeout (t .Context (), 10 * time .Second )
232231 defer cancel ()
@@ -236,30 +235,50 @@ func (s *standaloneActivityTestSuite) Test_PollActivityExecution_NoWait() {
236235 startResp , err := s .startActivity (ctx , activityID , taskQueue )
237236 require .NoError (t , err )
238237
239- pollResp , err := s .FrontendClient ().PollActivityExecution (ctx , & workflowservice.PollActivityExecutionRequest {
240- Namespace : s .Namespace ().String (),
241- ActivityId : activityID ,
242- RunId : startResp .RunId ,
243- IncludeInfo : true ,
244- IncludeInput : true ,
245- IncludeOutcome : true ,
238+ t .Run ("MinimalResponse" , func (t * testing.T ) {
239+ pollResp , err := s .FrontendClient ().PollActivityExecution (ctx , & workflowservice.PollActivityExecutionRequest {
240+ Namespace : s .Namespace ().String (),
241+ ActivityId : activityID ,
242+ RunId : startResp .RunId ,
243+ IncludeInfo : false ,
244+ IncludeInput : false ,
245+ IncludeOutcome : false ,
246+ })
247+ require .NoError (t , err )
248+ require .NotNil (t , pollResp .StateChangeLongPollToken )
249+ require .Equal (t , startResp .RunId , pollResp .RunId )
250+ require .Nil (t , pollResp .Info )
251+ require .Nil (t , pollResp .Input )
252+ require .Nil (t , pollResp .GetResult ())
253+ require .Nil (t , pollResp .GetFailure ())
246254 })
247- require .NoError (t , err )
248- require .NotNil (t , pollResp .StateChangeLongPollToken )
249- require .NotNil (t , pollResp .Info )
250- s .assertActivityExecutionInfo (
251- t ,
252- pollResp .Info ,
253- activityID ,
254- startResp .RunId ,
255- enumspb .PENDING_ACTIVITY_STATE_SCHEDULED ,
256- )
257- require .NotNil (t , pollResp .Input )
258- require .Equal (t , "test-activity-input" , string (pollResp .Input .Payloads [0 ].Data ))
259255
260- // Activity is scheduled but not completed, so no outcome yet
261- require .Nil (t , pollResp .GetResult ())
262- require .Nil (t , pollResp .GetFailure ())
256+ t .Run ("FullResponse" , func (t * testing.T ) {
257+ pollResp , err := s .FrontendClient ().PollActivityExecution (ctx , & workflowservice.PollActivityExecutionRequest {
258+ Namespace : s .Namespace ().String (),
259+ ActivityId : activityID ,
260+ RunId : startResp .RunId ,
261+ IncludeInfo : true ,
262+ IncludeInput : true ,
263+ IncludeOutcome : true ,
264+ })
265+ require .NoError (t , err )
266+ require .NotNil (t , pollResp .StateChangeLongPollToken )
267+ require .NotNil (t , pollResp .Info )
268+ s .assertActivityExecutionInfo (
269+ t ,
270+ pollResp .Info ,
271+ activityID ,
272+ startResp .RunId ,
273+ enumspb .PENDING_ACTIVITY_STATE_SCHEDULED ,
274+ )
275+ require .NotNil (t , pollResp .Input )
276+ require .Equal (t , "test-activity-input" , string (pollResp .Input .Payloads [0 ].Data ))
277+
278+ // Activity is scheduled but not completed, so no outcome yet
279+ require .Nil (t , pollResp .GetResult ())
280+ require .Nil (t , pollResp .GetFailure ())
281+ })
263282}
264283
265284func (s * standaloneActivityTestSuite ) Test_PollActivityExecution_WaitAnyStateChange () {
0 commit comments