From 00723d34c3d38507cf0e082ab04fe6b0aee2e44f Mon Sep 17 00:00:00 2001 From: florijan Date: Tue, 12 Sep 2017 14:29:35 +0200 Subject: [PATCH] Harness - match group setup fix Summary: I was mistaken in my calculations before and gave it +-3sigma tolerance (0.0027 probability of failure). Now I changed it to +-5sigma, which is good enough for CERN, and should be for us too. Reviewers: mislav.bradac, mferencevic Reviewed By: mislav.bradac Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D780 --- tests/macro_benchmark/harness/groups/match/setup.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/macro_benchmark/harness/groups/match/setup.py b/tests/macro_benchmark/harness/groups/match/setup.py index 0cc0521b0..0268836d3 100644 --- a/tests/macro_benchmark/harness/groups/match/setup.py +++ b/tests/macro_benchmark/harness/groups/match/setup.py @@ -63,12 +63,16 @@ def main(): print(";") print("MATCH (n) RETURN assert(count(n) = %d);" % VERTEX_COUNT) - # create edges + # create edges stohastically + attempts = VERTEX_COUNT ** 2 + p = EDGE_COUNT / VERTEX_COUNT ** 2 print("MATCH (a) WITH a MATCH (b) WITH a, b WHERE rand() < %f " - " CREATE (a)-[:EdgeType]->(b);" % (EDGE_COUNT / VERTEX_COUNT ** 2)) + " CREATE (a)-[:EdgeType]->(b);" % p) + sigma = (attempts * p * (1 - p)) ** 0.5 + delta = 5 * sigma print("MATCH (n)-[r]->() WITH count(r) AS c " "RETURN assert(c >= %d AND c <= %d);" % ( - EDGE_COUNT * 0.98, EDGE_COUNT * 1.02)) + EDGE_COUNT - delta, EDGE_COUNT + delta)) if __name__ == "__main__":