Skip to content

Commit 366cf80

Browse files
committed
Fix test
Signed-off-by: Neil Xie <[email protected]>
1 parent 9c4cc1c commit 366cf80

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

service/history/task/transfer_active_task_executor_test.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2242,6 +2242,17 @@ func createRecordWorkflowExecutionStartedRequest(
22422242
"Header_context_key": contextValueJSONString,
22432243
}
22442244
}
2245+
// Add CronSchedule to search attributes if it's a cron workflow
2246+
if len(executionInfo.CronSchedule) > 0 {
2247+
cronScheduleBytes, err := json.Marshal(executionInfo.CronSchedule)
2248+
if err != nil {
2249+
t.Fatal(err)
2250+
}
2251+
if searchAttributes == nil {
2252+
searchAttributes = make(map[string][]byte)
2253+
}
2254+
searchAttributes[definition.CronSchedule] = cronScheduleBytes
2255+
}
22452256
return &persistence.RecordWorkflowExecutionStartedRequest{
22462257
Domain: domainName,
22472258
DomainUUID: taskInfo.DomainID,
@@ -2293,6 +2304,17 @@ func createRecordWorkflowExecutionClosedRequest(
22932304
"Header_context_key": contextValueJSONString,
22942305
}
22952306
}
2307+
// Add CronSchedule to search attributes if it's a cron workflow
2308+
if len(executionInfo.CronSchedule) > 0 {
2309+
cronScheduleBytes, err := json.Marshal(executionInfo.CronSchedule)
2310+
if err != nil {
2311+
t.Fatal(err)
2312+
}
2313+
if searchAttributes == nil {
2314+
searchAttributes = make(map[string][]byte)
2315+
}
2316+
searchAttributes[definition.CronSchedule] = cronScheduleBytes
2317+
}
22962318
return &persistence.RecordWorkflowExecutionClosedRequest{
22972319
Domain: domainName,
22982320
DomainUUID: taskInfo.DomainID,

0 commit comments

Comments
 (0)