mirror of
https://github.com/LorenEteval/Furious.git
synced 2026-10-05 21:37:56 +03:00
Clarify external command timeout ownership
Signed-off-by: Loren Eteval <loren.eteval@proton.me>
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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),
|
||||
],
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user