Skip to content

Commit

Permalink
fixup! feat(runtime): add disruption mitigation
Browse files Browse the repository at this point in the history
  • Loading branch information
hspedro committed Mar 13, 2024
1 parent 276965d commit 63c97fe
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/adapters/runtime/kubernetes/scheduler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,10 @@ func TestMitigateDisruption(t *testing.T) {
require.NoError(t, err)
require.NotNil(t, pdb)
require.Equal(t, pdb.Name, scheduler.Name)
require.Equal(t, pdb.Spec.MinAvailable.IntVal, int32(float64(newValue)*(DefaultDisruptionSafetyPercentage/100+1.0)))

incSafetyPercentage := 1.0 + (DefaultDisruptionSafetyPercentage / 100)
t.Log("incSafetyPercentage: ", incSafetyPercentage)
t.Log("newRoomAmount: ", float64(newValue)*incSafetyPercentage)
require.Equal(t, int32(float64(newValue)*incSafetyPercentage), pdb.Spec.MinAvailable.IntVal)
})
}

0 comments on commit 63c97fe

Please sign in to comment.