Fix comment and assert score in test case
This commit is contained in:
parent
f0b9f8e37a
commit
374eee421f
|
@ -215,7 +215,8 @@ func evenSpreadScoreBoost(pset *propertySet, option *structs.Node) float64 {
|
|||
// Maximum possible penalty when the distribution is even
|
||||
return -1.0
|
||||
} else if minCount == 0 {
|
||||
// Maximum possible boost
|
||||
// Current attribute count is equal to min and both are zero. This means no allocations
|
||||
// were placed for this attribute value yet. Should get the maximum possible boost.
|
||||
return 1.0
|
||||
}
|
||||
|
||||
|
|
|
@ -566,4 +566,5 @@ func Test_evenSpreadScoreBoost(t *testing.T) {
|
|||
}
|
||||
boost := evenSpreadScoreBoost(pset, opt)
|
||||
require.False(t, math.IsInf(boost, 1))
|
||||
require.Equal(t, 1.0, boost)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue