Changing the test to allocate on nodes with a non-trivial
instance policy has two advantages.
- We test in a more realistic (and also more challenging)
environment.
- Once the lower limit of the ipolicy is reached no more
allocations are possible, thus having fewer shrinking
rounds---and hence speeding up the test by a factor of 4.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>
import Test.QuickCheck hiding (Result)
+import Control.Monad (liftM)
import qualified Data.IntMap as IntMap
import Data.Maybe
prop_CanTieredAlloc :: Property
prop_CanTieredAlloc =
forAll (choose (2, 5)) $ \count ->
- forAll (genOnlineNode `suchThat` isNodeBig 4) $ \node ->
+ forAll (liftM (Node.setPolicy Types.defIPolicy)
+ (genOnlineNode `suchThat` isNodeBig 4)) $ \node ->
forAll (genInstanceMaybeBiggerThanNode node) $ \inst ->
let nl = makeSmallCluster node count
il = Container.empty