Skip to content

Commit

Permalink
test: Extend timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
kmyk committed Jul 11, 2021
1 parent 15b393e commit 55bc63a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions scripts/integration_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ def collect_input_cases(script: pathlib.Path, *, tempdir: pathlib.Path) -> List[
outputcase = tempdir / "{}.{}-{}.out".format(script.stem, testset_name, i)
with open(inputcase, 'wb') as fh:
try:
subprocess.check_call([sys.executable, str(generator_path)], stdout=fh, timeout=2)
subprocess.check_call([sys.executable, str(generator_path)], stdout=fh, timeout=5)
except subprocess.SubprocessError as e:
logger.error('%s: %s: failed to generate an input of a random case: %s', str(script), str(inputcase), e)
return []
with open(inputcase, 'rb') as fh1:
with open(outputcase, 'wb') as fh2:
try:
subprocess.check_call([sys.executable, str(solver_path)], stdin=fh1, stdout=fh2, timeout=2)
subprocess.check_call([sys.executable, str(solver_path)], stdin=fh1, stdout=fh2, timeout=5)
except subprocess.SubprocessError as e:
logger.error('%s: %s: failed to generate an output of a random case: %s', str(script), str(inputcase), e)
return []
Expand All @@ -64,12 +64,12 @@ def run_integration_test(script: pathlib.Path, *, executable: pathlib.Path) -> b
logger.info('%s: compiling...', str(script))
with open(tempdir / 'main.cpp', 'wb') as fh:
try:
subprocess.check_call([str(executable), 'convert', str(script)], stdout=fh, timeout=10)
subprocess.check_call([str(executable), 'convert', str(script)], stdout=fh, timeout=20)
except subprocess.SubprocessError as e:
logger.error('%s: failed to compile from Python to C++: %s', str(script), e)
return False
try:
subprocess.check_call(['g++', '-std=c++17', '-Wall', '-O2', '-I', str(pathlib.Path('runtime', 'include')), '-o', str(tempdir / 'a.exe'), str(tempdir / 'main.cpp')], timeout=10)
subprocess.check_call(['g++', '-std=c++17', '-Wall', '-O2', '-I', str(pathlib.Path('runtime', 'include')), '-o', str(tempdir / 'a.exe'), str(tempdir / 'main.cpp')], timeout=20)
except subprocess.SubprocessError as e:
logger.error('%s: failed to compile from C++ to executable: %s', str(script), e)
return False
Expand Down Expand Up @@ -98,7 +98,7 @@ def run_integration_test(script: pathlib.Path, *, executable: pathlib.Path) -> b
logger.info('%s: %s: running as %s...', str(script), str(inputcase), title)
with open(inputcase, 'rb') as fh:
try:
actual = subprocess.check_output(command, stdin=fh, timeout=10)
actual = subprocess.check_output(command, stdin=fh, timeout=20)
except subprocess.SubprocessError as e:
logger.error('%s: %s: failed to run as %s: %s', str(script), str(inputcase), title, e)
return False
Expand Down

0 comments on commit 55bc63a

Please sign in to comment.