migrate scheduler api types to sized integers

This commit is contained in:
Ahmad Diaa
2019-09-03 17:59:24 +02:00
parent b3c4bdea49
commit 801cc549be
22 changed files with 75 additions and 73 deletions

View File

@@ -17,6 +17,7 @@ limitations under the License.
package factory
import (
"math"
"testing"
"github.com/stretchr/testify/assert"
@@ -58,13 +59,13 @@ func TestValidatePriorityConfigOverFlow(t *testing.T) {
expected bool
}{
{
description: "one of the weights is MaxInt",
configs: []priorities.PriorityConfig{{Weight: api.MaxInt}, {Weight: 5}},
description: "one of the weights is MaxInt64",
configs: []priorities.PriorityConfig{{Weight: math.MaxInt64}, {Weight: 5}},
expected: true,
},
{
description: "after multiplication with MaxPriority the weight is larger than MaxWeight",
configs: []priorities.PriorityConfig{{Weight: api.MaxInt/api.MaxPriority + api.MaxPriority}, {Weight: 5}},
configs: []priorities.PriorityConfig{{Weight: math.MaxInt64/api.MaxPriority + api.MaxPriority}, {Weight: 5}},
expected: true,
},
{