Commit 5b181e29 authored by Klaus Aehlig's avatar Klaus Aehlig
Browse files

CanTieredAlloc test: make instances big enough



Fix a subtle bug in the CanTieredAlloc test. The property we were
testing for was actually not valid with the addition of an ipolicy.
The lower policy bound for disk was 4 times the unit for disks (256M).
So, a valid node have free disk only slightly larger than the ipolicy
lower bound. When shrinking disks, however, we go in steps of full
units---and thus might miss the window of opportunity if that is smaller
that a full unit. So, only use nodes that have at least 5 units worth
of resources for every resource.
Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarHrvoje Ribicic <riba@google.com>
parent 2f1d9bd0
...@@ -170,7 +170,7 @@ prop_CanTieredAlloc :: Property ...@@ -170,7 +170,7 @@ prop_CanTieredAlloc :: Property
prop_CanTieredAlloc = prop_CanTieredAlloc =
forAll (choose (2, 5)) $ \count -> forAll (choose (2, 5)) $ \count ->
forAll (liftM (Node.setPolicy Types.defIPolicy) forAll (liftM (Node.setPolicy Types.defIPolicy)
(genOnlineNode `suchThat` isNodeBig 4)) $ \node -> (genOnlineNode `suchThat` isNodeBig 5)) $ \node ->
forAll (genInstanceMaybeBiggerThanNode node) $ \inst -> forAll (genInstanceMaybeBiggerThanNode node) $ \inst ->
let nl = makeSmallCluster node count let nl = makeSmallCluster node count
il = Container.empty il = Container.empty
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment