mirror of https://github.com/docker/docs.git
fix int overflow on non-amd64 platforms
Signed-off-by: Chanwit Kaewkasi <chanwit@gmail.com>
This commit is contained in:
parent
9920b547e0
commit
720d3c3eea
|
@ -41,7 +41,7 @@ func TestPlaceEqualWeight(t *testing.T) {
|
|||
// add 1 container 2G on node1
|
||||
config := createConfig(2, 0)
|
||||
assert.NoError(t, nodes[0].AddContainer(createContainer("c1", config)))
|
||||
assert.Equal(t, nodes[0].UsedMemory, 2*1024*1024*1024)
|
||||
assert.Equal(t, nodes[0].UsedMemory, int64(2*1024*1024*1024))
|
||||
|
||||
// add 2 containers 1G on node2
|
||||
config = createConfig(1, 0)
|
||||
|
@ -54,7 +54,7 @@ func TestPlaceEqualWeight(t *testing.T) {
|
|||
node, err := s.PlaceContainer(config, nodes)
|
||||
assert.NoError(t, err)
|
||||
assert.NoError(t, node.AddContainer(createContainer("c4", config)))
|
||||
assert.Equal(t, node.UsedMemory, 3*1024*1024*1024)
|
||||
assert.Equal(t, node.UsedMemory, int64(3*1024*1024*1024))
|
||||
|
||||
// check that the last container ended on the node with the highest number of containers
|
||||
assert.Equal(t, node.ID, nodes[1].ID)
|
||||
|
|
|
@ -19,7 +19,7 @@ func TestSpreadPlaceEqualWeight(t *testing.T) {
|
|||
// add 1 container 2G on node1
|
||||
config := createConfig(2, 0)
|
||||
assert.NoError(t, nodes[0].AddContainer(createContainer("c1", config)))
|
||||
assert.Equal(t, nodes[0].UsedMemory, 2*1024*1024*1024)
|
||||
assert.Equal(t, nodes[0].UsedMemory, int64(2*1024*1024*1024))
|
||||
|
||||
// add 2 containers 1G on node2
|
||||
config = createConfig(1, 0)
|
||||
|
@ -32,7 +32,7 @@ func TestSpreadPlaceEqualWeight(t *testing.T) {
|
|||
node, err := s.PlaceContainer(config, nodes)
|
||||
assert.NoError(t, err)
|
||||
assert.NoError(t, node.AddContainer(createContainer("c4", config)))
|
||||
assert.Equal(t, node.UsedMemory, 3*1024*1024*1024)
|
||||
assert.Equal(t, node.UsedMemory, int64(3*1024*1024*1024))
|
||||
|
||||
// check that the last container ended on the node with the lowest number of containers
|
||||
assert.Equal(t, node.ID, nodes[0].ID)
|
||||
|
|
Loading…
Reference in New Issue