When using a really random "extra cpus" variable, this can overflow
(especially on 32 bit) and thus the final value can be < 0, thus the
test will fail to fail.
It doesn't make sense to test with huge values, so let's just generate
a reasonable value.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
inst' = setInstanceSmallerThanNode node inst
inst'' = inst' { Instance.dsk = Instance.dsk inst }
-prop_Node_addPriFC (Positive extra) =
+prop_Node_addPriFC =
+ forAll (choose (1, maxCpu)) $ \extra ->
forAll genOnlineNode $ \node ->
forAll (arbitrary `suchThat` Instance.instanceNotOffline) $ \inst ->
let inst' = setInstanceSmallerThanNode node inst