From 381379e54171a8e2c59d58ff553ce8d6dece76c3 Mon Sep 17 00:00:00 2001 From: sunerpy Date: Sat, 24 Oct 2026 16:50:47 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E6=89=8B=E6=9C=BA=20IPC=20=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E7=AD=89=20updater=20=E5=B0=B1=E7=BB=AA=E5=90=8E?= =?UTF-8?q?=E5=86=8D=E8=B0=83=E7=94=A8=E6=9B=B4=E6=96=B0=E5=91=BD=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit setup 先管理 Bridge、再管理 updater,测试线程只等 Bridge 时,慢的 CI 机器上 update_status 会报 state not managed(2026-10-24,#184 的 rust gates)。在 setup 的这两步之间加 300 ms 延迟可以稳定复现;改为同时等 updater 后,32 核满载下连续 30 轮全部通过。 --- apps/mobile/src-tauri/tests/ipc.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/mobile/src-tauri/tests/ipc.rs b/apps/mobile/src-tauri/tests/ipc.rs index bf816c6..5029ca2 100644 --- a/apps/mobile/src-tauri/tests/ipc.rs +++ b/apps/mobile/src-tauri/tests/ipc.rs @@ -176,6 +176,9 @@ fn with_app_updating( let driver = std::thread::spawn(move || { let outcome = std::panic::catch_unwind(AssertUnwindSafe(|| { wait_for(|| handle.try_state::().map(|_| ())); + // `setup` manages the updater after the bridge, which publishes its first status: a + // command that needs it, such as `update_status`, fails until then (2026-10-24, CI). + wait_for(|| handle.try_state::>().map(|_| ())); body(&handle, &webview, &rx); })); // Closing the only window ends the mock event loop, so `app.run` below returns.