Skip to content

Fix compilation of matching_simulation_test.go #6659

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should probably add at least "default" case to the CI to catch these in the future (can also validate latencies are within some range etc.)

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
Loading