mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 00:35:00 +00:00
added back timeout
This commit is contained in:
parent
ec4dc74de4
commit
b852c35828
1 changed files with 17 additions and 10 deletions
|
@ -369,20 +369,27 @@ def run_unit_tests(testdir, history_fname):
|
|||
]
|
||||
print(" ".join(command))
|
||||
|
||||
result = subprocess.run(
|
||||
command,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT,
|
||||
text=True,
|
||||
)
|
||||
|
||||
res = result.stdout
|
||||
res = cleanup_test_output(res)
|
||||
timeout = 60
|
||||
try:
|
||||
result = subprocess.run(
|
||||
command,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT,
|
||||
text=True,
|
||||
timeout=timeout,
|
||||
)
|
||||
except subprocess.TimeoutExpired:
|
||||
success = False
|
||||
res = f"Tests timed out after {timeout} secs!"
|
||||
else:
|
||||
success = result.returncode == 0
|
||||
res = result.stdout
|
||||
res = cleanup_test_output(res)
|
||||
|
||||
with history_fname.open("a") as fh:
|
||||
fh.write(f"```\n{res}\n```")
|
||||
|
||||
if result.returncode != 0:
|
||||
if not success:
|
||||
print(f"Tests failed: {testdir}")
|
||||
return res
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue