Skip to content

Commit c393525

Browse files
committed
Introduce a timeout to test execution
We have seen a few infinite spins in SourceKit-LSP testing recently. We should fix those spins but as a last stop-gap measure, introduce a timeout to all subprocess invocations, which will at least give us a failure instead of infinite waiting.
1 parent 909c0a9 commit c393525

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Utilities/build-script-helper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def check_call(cmd: List[str], additional_env: Dict[str, str] = {}, verbose: boo
5555
if verbose:
5656
print_cmd(cmd=cmd, additional_env=additional_env)
5757

58-
subprocess.check_call(cmd, env=env_with_additional_env(additional_env), stderr=subprocess.STDOUT)
58+
subprocess.check_call(cmd, env=env_with_additional_env(additional_env), stderr=subprocess.STDOUT, timeout=60 * 60)
5959

6060

6161
def check_output(cmd: List[str], additional_env: Dict[str, str] = {}, capture_stderr: bool = True, verbose: bool = False) -> str:
@@ -65,7 +65,7 @@ def check_output(cmd: List[str], additional_env: Dict[str, str] = {}, capture_st
6565
stderr = subprocess.STDOUT
6666
else:
6767
stderr = subprocess.DEVNULL
68-
return subprocess.check_output(cmd, env=env_with_additional_env(additional_env), stderr=stderr, encoding='utf-8')
68+
return subprocess.check_output(cmd, env=env_with_additional_env(additional_env), stderr=stderr, encoding='utf-8', timeout=60 * 60)
6969

7070
# -----------------------------------------------------------------------------
7171
# SwiftPM wrappers

0 commit comments

Comments
 (0)