Skip to content

Commit

Permalink
Fix compilation of matching_simulation_test.go (cadence-workflow#6659)
Browse files Browse the repository at this point in the history
  • Loading branch information
natemort authored Feb 7, 2025
1 parent 3540eeb commit 4b30b13
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions simulation/matching/matching_simulation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ func (s *MatchingSimulationSuite) TestMatchingSimulation() {
TaskList: &types.TaskList{Name: tasklist, Kind: types.TaskListKindNormal.Ptr()},
TaskListType: types.TaskListTypeDecision.Ptr(),
PartitionConfig: &types.TaskListPartitionConfig{
NumReadPartitions: int32(getPartitions(s.TestClusterConfig.MatchingConfig.SimulationConfig.TaskListReadPartitions)),
NumWritePartitions: int32(getPartitions(s.TestClusterConfig.MatchingConfig.SimulationConfig.TaskListWritePartitions)),
ReadPartitions: getPartitions(s.TestClusterConfig.MatchingConfig.SimulationConfig.TaskListReadPartitions),
WritePartitions: getPartitions(s.TestClusterConfig.MatchingConfig.SimulationConfig.TaskListWritePartitions),
},
})
s.NoError(err)
Expand Down Expand Up @@ -600,11 +600,17 @@ func getTaskIsolationGroups(c host.SimulationTaskConfiguration) []string {
return c.IsolationGroups
}

func getPartitions(i int) int {
func getPartitions(i int) map[int]*types.TaskListPartition {
if i == 0 {
return 1
return map[int]*types.TaskListPartition{
0: {},
}
}
return i
result := make(map[int]*types.TaskListPartition)
for j := 0; j < i; j++ {
result[j] = &types.TaskListPartition{}
}
return result
}

func getForwarderMaxOutstandingPolls(i int) int {
Expand Down

0 comments on commit 4b30b13

Please sign in to comment.