MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / issue_queries

Function issue_queries

tests/fuzz/process.py:25–49  ·  view source on GitHub ↗
(graph, timeout)

Source from the content-addressed store, hash-verified

23
24
25def issue_queries(graph, timeout):
26 os.environ["PATH"] = os.pathsep.join([ENV['PATH'], site.getuserbase() + '/bin'])
27 os.environ["PYTHONPATH"] = os.pathsep.join([ENV['PYTHONPATH'], HERE + "/generator"])
28 cmd = ["grammarinator-generate", "CustomCypherGenerator.CustomCypherGenerator",
29 "--sys-path", "generator/", "--jobs", "1", "-r", "oC_Query", "--stdout", "-d", "30"]
30
31 start = time()
32 while time() - start < timeout:
33 # Capture generated queries
34 try:
35 query = subprocess.check_output(cmd, encoding="utf8")
36 except subprocess.CalledProcessError as e:
37 # Subprocess failed, emit the thrown exception and retry
38 print(str(e))
39 continue
40
41 # Log query to console
42 print(query)
43 try:
44 graph.query(query, timeout=1000)
45 except ResponseError as e:
46 print("Encountered exception: %s" % str(e))
47 except ConnectionError as e:
48 # The previous query crashed the server, exit with exception
49 raise(e)
50
51
52parser = argparse.ArgumentParser()

Callers 1

process.pyFile · 0.85

Calls 2

strFunction · 0.85
queryMethod · 0.45

Tested by

no test coverage detected