LGTM, thanks On Tue, Jan 12, 2016 at 6:06 PM, 'Klaus Aehlig' via ganeti-devel < [email protected]> wrote:
> A lot of our tests work by generating a node and a > strictly smaller instance and then continue under > the assumption that the instance will fit on the node. > To obtain a strictly smaller instance, we take an instance > of size at most half the free resources of the node. The > problem with this approach is that we also require minimal > resources of an instance (for examples to be realistic); now, > this can lead to an upper bound lower than the lower bound > and, by the way QuickCheck's `choose` works, still a value > between these bounds is chosen, violating the assumptions > about node and instance sizes. > > To avoid those problems, set the minimal resources of an > allocatable node so that half of them is still bigger than > the minimal resources of an instance. > > Signed-off-by: Klaus Aehlig <[email protected]> > Reviewed-by: Lisa Velden <[email protected]> > > Cherry-picked-from: 6ccf05c1507c58e > Signed-off-by: Klaus Aehlig <[email protected]> > --- > test/hs/Test/Ganeti/HTools/Node.hs | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/test/hs/Test/Ganeti/HTools/Node.hs > b/test/hs/Test/Ganeti/HTools/Node.hs > index 9177ba7..d782fe2 100644 > --- a/test/hs/Test/Ganeti/HTools/Node.hs > +++ b/test/hs/Test/Ganeti/HTools/Node.hs > @@ -113,10 +113,10 @@ genOnlineNode :: Gen Node.Node > genOnlineNode = > arbitrary `suchThat` (\n -> not (Node.offline n) && > not (Node.failN1 n) && > - Node.availDisk n > 0 && > - Node.availMem n > 0 && > - Node.availCpu n > 0 && > - Node.tSpindles n > 0) > + Node.availDisk n > 2 * Types.unitDsk && > + Node.availMem n > 2 * Types.unitMem && > + Node.availCpu n > 2 && > + Node.tSpindles n > 2) > > -- | Generate a node with exclusive storage enabled. > genExclStorNode :: Gen Node.Node > -- > 2.6.0.rc2.230.g3dd15c0 > > Hrvoje Ribicic Ganeti Engineering Google Germany GmbH Dienerstr. 12, 80331, München Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Diese E-Mail ist vertraulich. Wenn Sie nicht der richtige Adressat sind, leiten Sie diese bitte nicht weiter, informieren Sie den Absender und löschen Sie die E-Mail und alle Anhänge. Vielen Dank. This e-mail is confidential. If you are not the right addressee please do not forward it, please inform the sender, and please erase this e-mail including any attachments. Thanks.
