Addressed review comments.

This commit is contained in:
kgrygiel 2018-03-01 10:49:17 +01:00
parent ee24cc2325
commit e5e9587c62
2 changed files with 5 additions and 5 deletions

View File

@ -99,9 +99,9 @@ func TestConfidenceMultiplierEstimatorNoHistory(t *testing.T) {
testedEstimator2 := &confidenceMultiplierEstimator{-1.0, baseEstimator}
s := newAggregateContainerState()
// Expect testedEstimator1 to return the maximum possible resource amount.
assert.Equal(t, 1e11, model.CoresFromCPUAmount(
testedEstimator1.GetResourceEstimation(s)[model.ResourceCPU]))
assert.Equal(t, model.ResourceAmount(1e14),
testedEstimator1.GetResourceEstimation(s)[model.ResourceCPU])
// Expect testedEstimator2 to return zero.
assert.Equal(t, 0.0, model.CoresFromCPUAmount(
testedEstimator2.GetResourceEstimation(s)[model.ResourceCPU]))
assert.Equal(t, model.ResourceAmount(0),
testedEstimator2.GetResourceEstimation(s)[model.ResourceCPU])
}

View File

@ -102,7 +102,7 @@ func ResourcesAsResourceList(resources Resources) apiv1.ResourceList {
// RoundResourceAmount returns the given resource amount rounded down to the
// whole multiple of another resource amount (unit).
func RoundResourceAmount(amount ResourceAmount, unit ResourceAmount) ResourceAmount {
func RoundResourceAmount(amount, unit ResourceAmount) ResourceAmount {
return ResourceAmount(int64(amount) - int64(amount)%int64(unit))
}