Skip to content

Commit 4918a8f

Browse files
committed
Fix VPA tests since VPA mutex can't be copied
Since I added a mutex to the VPA model, the checkpoint text can no longer copy it by value and has to use references. This just updates the checkpoint writer test to account for this. Signed-off-by: John Kyros <[email protected]>
1 parent e379e1e commit 4918a8f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

vertical-pod-autoscaler/pkg/recommender/checkpoint/checkpoint_writer_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,15 @@ func TestMergeContainerStateForCheckpointDropsRecentMemoryPeak(t *testing.T) {
108108
func TestIsFetchingHistory(t *testing.T) {
109109

110110
testCases := []struct {
111-
vpa model.Vpa
111+
vpa *model.Vpa
112112
isFetchingHistory bool
113113
}{
114114
{
115-
vpa: model.Vpa{},
115+
vpa: &model.Vpa{},
116116
isFetchingHistory: false,
117117
},
118118
{
119-
vpa: model.Vpa{
119+
vpa: &model.Vpa{
120120
PodSelector: nil,
121121
Conditions: map[vpa_types.VerticalPodAutoscalerConditionType]vpa_types.VerticalPodAutoscalerCondition{
122122
vpa_types.FetchingHistory: {
@@ -128,7 +128,7 @@ func TestIsFetchingHistory(t *testing.T) {
128128
isFetchingHistory: false,
129129
},
130130
{
131-
vpa: model.Vpa{
131+
vpa: &model.Vpa{
132132
PodSelector: nil,
133133
Conditions: map[vpa_types.VerticalPodAutoscalerConditionType]vpa_types.VerticalPodAutoscalerCondition{
134134
vpa_types.FetchingHistory: {
@@ -142,7 +142,7 @@ func TestIsFetchingHistory(t *testing.T) {
142142
}
143143

144144
for _, tc := range testCases {
145-
assert.Equalf(t, tc.isFetchingHistory, isFetchingHistory(&tc.vpa), "%+v should have %v as isFetchingHistoryResult", tc.vpa, tc.isFetchingHistory)
145+
assert.Equalf(t, tc.isFetchingHistory, isFetchingHistory(tc.vpa), "%+v should have %v as isFetchingHistoryResult", tc.vpa, tc.isFetchingHistory)
146146
}
147147
}
148148

0 commit comments

Comments
 (0)