@@ -131,6 +131,7 @@ func doTestTimerWorkflow(t *testing.T, backendType service.BackendType, config *
131
131
}).Execute ()
132
132
failTestAtHttpError (err , httpResp , t )
133
133
134
+ // Short wait for timers to get initialized in state
134
135
time .Sleep (time .Second * 1 )
135
136
timerInfos := service.GetCurrentTimerInfosQueryResponse {}
136
137
err = uclient .QueryWorkflow (context .Background (), & timerInfos , wfId , "" , service .GetCurrentTimerInfosQueryType )
@@ -171,6 +172,7 @@ func doTestTimerWorkflow(t *testing.T, backendType service.BackendType, config *
171
172
}).Execute ()
172
173
failTestAtHttpError (err , httpResp , t )
173
174
175
+ // Short wait for signal to be received and timer to be skipped
174
176
time .Sleep (time .Second * 1 )
175
177
timerInfos = service.GetCurrentTimerInfosQueryResponse {}
176
178
err = uclient .QueryWorkflow (context .Background (), & timerInfos , wfId , "" , service .GetCurrentTimerInfosQueryType )
@@ -180,14 +182,14 @@ func doTestTimerWorkflow(t *testing.T, backendType service.BackendType, config *
180
182
timer2 .Status = service .TimerSkipped
181
183
assertTimerQueryResponseEqual (assertions , expectedTimerInfos , timerInfos )
182
184
183
- time .Sleep (time .Second * 1 )
184
185
httpResp , err = req3 .WorkflowSkipTimerRequest (iwfidl.WorkflowSkipTimerRequest {
185
186
WorkflowId : wfId ,
186
187
WorkflowStateExecutionId : "S1-1" ,
187
188
TimerCommandIndex : iwfidl .PtrInt32 (2 ),
188
189
}).Execute ()
189
190
failTestAtHttpError (err , httpResp , t )
190
191
192
+ // Short wait for signal to be received and timer to be skipped
191
193
time .Sleep (time .Second * 1 )
192
194
timerInfos = service.GetCurrentTimerInfosQueryResponse {}
193
195
err = uclient .QueryWorkflow (context .Background (), & timerInfos , wfId , "" , service .GetCurrentTimerInfosQueryType )
@@ -197,7 +199,7 @@ func doTestTimerWorkflow(t *testing.T, backendType service.BackendType, config *
197
199
timer3 .Status = service .TimerSkipped
198
200
assertTimerQueryResponseEqual (assertions , expectedTimerInfos , timerInfos )
199
201
200
- // wait for the workflow
202
+ // Wait for the workflow to complete
201
203
req2 := apiClient .DefaultApi .ApiV1WorkflowGetWithWaitPost (context .Background ())
202
204
_ , httpResp , err = req2 .WorkflowGetRequest (iwfidl.WorkflowGetRequest {
203
205
WorkflowId : wfId ,
@@ -215,7 +217,7 @@ func doTestTimerWorkflow(t *testing.T, backendType service.BackendType, config *
215
217
assertions .Equal ("timer-cmd-id" , data ["timer_id" ])
216
218
assertions .True (duration >= 9 && duration <= 11 , duration )
217
219
218
- // reset with all signals reserved (default behavior)
220
+ // Reset with all signals reserved (default behavior)
219
221
// Therefore, the skip timer would be reapplied
220
222
req4 := apiClient .DefaultApi .ApiV1WorkflowResetPost (context .Background ())
221
223
_ , httpResp , err = req4 .WorkflowResetRequest (iwfidl.WorkflowResetRequest {
0 commit comments