From daf19282ec7783346104ca65b01e4e5f1e2c7128 Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Thu, 30 Apr 2015 20:36:20 +0200 Subject: Specify timeout when generating test cases --- prolog/engine.py | 4 ++-- 1 file 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 -- cgit v1.2.1