Skip to content
Snippets Groups Projects
Commit c3a8e06d authored by Iustin Pop's avatar Iustin Pop
Browse files

Fix arbitrary ConfigData object generation


The Cluster object, as it is defined right now, has many '[String]'
members, which means that in a standard arbitrary generator these will
become very big, which is the reason for the current slowness of the
test 'Config_serialisation'.

By resizing the generator to 8 (arbitrary chosen to limit the list
length and the string sizes), and by reducing a bit the node count, we
can make this test be as fast as the others (about 10x
improvement). This means we can test more cases, for the same cost.

Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent 9e679143
No related branches found
No related tags found
No related merge requests found
......@@ -187,7 +187,7 @@ genEmptyCluster ncount = do
grp <- arbitrary
let contgroups = Container $ Map.singleton guuid grp
serial <- arbitrary
cluster <- arbitrary
cluster <- resize 8 arbitrary
let c = ConfigData version cluster contnodes contgroups continsts serial
return c
......@@ -227,7 +227,7 @@ prop_Inst_serialisation = testSerialisation
-- | Check config serialisation.
prop_Config_serialisation :: Property
prop_Config_serialisation =
forAll (choose (0, maxNodes) >>= genEmptyCluster) testSerialisation
forAll (choose (0, maxNodes `div` 4) >>= genEmptyCluster) testSerialisation
testSuite "Objects"
[ 'prop_fillDict
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment