597
func (s *ExecutionMutableStateTaskSuite) RandomPaginateRange(
598
createdTasks []tasks.Task,
600
>
numTasks := len(createdTasks)
601
>
firstTaskIdx := rand.Intn(numTasks/2 - 1)
602
>
nextTaskIdx := firstTaskIdx + rand.Intn(numTasks/2-1) + 1
603
>
604
>
inclusiveMinTaskKey := createdTasks[firstTaskIdx].GetKey()
605
>
var exclusiveMaxTaskKey tasks.Key
606
>
if nextTaskIdx == numTasks {
607
exclusiveMaxTaskKey = tasks.NewKey(
608
createdTasks[numTasks-1].GetVisibilityTime().Add(time.Second),
609
createdTasks[numTasks-1].GetTaskID()+10,
610
)
612
>
exclusiveMaxTaskKey = createdTasks[nextTaskIdx].GetKey()
613
>
}
614
616
>
switch taskCategory.Type() {
617
case tasks.CategoryTypeImmediate:
618
inclusiveMinTaskKey.FireTime = tasks.DefaultFireTime