summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimotej Lazar <timotej.lazar@araneo.org>2015-04-30 20:36:20 +0200
committerAleš Smodiš <aless@guru.si>2015-08-11 14:26:03 +0200
commitdaf19282ec7783346104ca65b01e4e5f1e2c7128 (patch)
tree70beadfe4b5c708343d5ffae067716169c0073b1
parentda61566394f12d1a32b6f5b0e83637abd311c237 (diff)
Specify timeout when generating test cases
-rw-r--r--prolog/engine.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/prolog/engine.py b/prolog/engine.py
index be19fec..048190a 100644
--- a/prolog/engine.py
+++ b/prolog/engine.py
@@ -129,14 +129,14 @@ def test(name, code):
# Try to generate a random test case for problem [name] with [solution] that
# fails for [code]. Give up after [tries] attempts.
-def create_failing_test(name, solution, code, tries=20):
+def create_failing_test(name, solution, code, tries=10):
try:
for i in range(tries):
reply = create_and_ask(code=solution,
query='create_test({}, Test)'.format(name))
testcase = reply['data'][0]['Test']
reply = create_and_ask(code=code,
- query='run_test({}, Result)'.format(testcase))
+ query='run_test({}, Result, 0.1)'.format(testcase))
result = reply['data'][0]['Result']
if not result.startswith('success'):
return testcase