Skip to content

armgit / peach

Public Imported from GitHub
0

Peach: Local-first video metadata scraper and media manager.

test(desktop): 卸载助手用例的子进程上限放宽到 120 秒

longmeidaod4190032bc95
diff --git a/tests/test_desktop_settings.py b/tests/test_desktop_settings.py
index cf2e5fabc..9f7b3dfbf 100644
--- a/tests/test_desktop_settings.py
+++ b/tests/test_desktop_settings.py
@@ -379,10 +379,12 @@ class DesktopSettingsTests(unittest.TestCase):
payload = dict(job, pid=2147483647, quiet=True)
if log is not None:
payload['log'] = str(log)
+ # 助手每轮重试都要枚举一遍全部进程的路径;本机七百多个进程时一遍约 9 秒,
+ # 删不掉文件的用例要走满三轮,30 秒的上限正好卡在它的正常耗时上。
return subprocess.run([str(shell), '-NoProfile', '-NonInteractive', '-EncodedCommand',
base64.b64encode(desktop_uninstall._SCRIPT.encode('utf-16-le')).decode('ascii')],
input=json.dumps(payload).encode('utf-8'), capture_output=True,
- timeout=30, creationflags=subprocess.CREATE_NO_WINDOW)
+ timeout=120, creationflags=subprocess.CREATE_NO_WINDOW)
@unittest.skipUnless(os.name == 'nt', 'Windows 系统卸载助手')
def test_native_uninstall_kills_strays_running_from_the_program(self):