Clarify external command timeout ownership

Signed-off-by: Loren Eteval <loren.eteval@proton.me>
This commit is contained in:
Loren Eteval
2026-08-20 20:14:09 +08:00
parent 5526da7267
commit 44744d6da4
2 changed files with 7 additions and 6 deletions
+4 -3
View File
@@ -182,10 +182,11 @@ def parseHostPort(address: str) -> Tuple[AnyStr | None, str | None]:
def runExternalCommand(*args, **kwargs):
"""Run a blocking external command with a bounded default wait.
"""Run a blocking external command using caller-supplied subprocess options.
Callers remain responsible for keeping potentially slow host
operations off the GUI thread.
This low-level wrapper intentionally does not impose a timeout. Callers
decide whether their command may wait indefinitely and remain responsible
for keeping potentially slow host operations off the GUI thread.
"""
if PLATFORM == 'Windows':
creationflags = kwargs.pop('creationflags', subprocess.CREATE_NO_WINDOW)
+3 -3
View File
@@ -166,8 +166,8 @@ class FrozenlibUtilityTest(unittest.TestCase):
with self.assertRaises(ValueError):
UtilityModule.callRateLimited(-1)
def testExternalCommandsHaveAnOverridableBoundedTimeout(self):
"""Apply the shared timeout without invoking a real child process."""
def testExternalCommandsPreserveCallerTimeoutPolicy(self):
"""Forward caller options without imposing a shared command timeout."""
completed = subprocess.CompletedProcess(['fixture'], 0)
with (
@@ -190,7 +190,7 @@ class FrozenlibUtilityTest(unittest.TestCase):
self.assertEqual(
run.call_args_list,
[
mock.call(['fixture'], timeout=30.0),
mock.call(['fixture']),
mock.call(['fixture'], timeout=1.5),
],
)