From df0e63b39d27f100927a9957dcdd90f394166826 Mon Sep 17 00:00:00 2001 From: NimBold Date: Thu, 27 Aug 2026 19:59:41 +0330 Subject: [PATCH] test(startup): isolate Aria2 poller crash path (#37) - Issue #37: add a smoke-only switch that disables the new Aria2 poller.\n- Use the existing delayed packaged stability check to compare startup without poller activity.\n\nRefs #37. --- scripts/smoke-packaged-app.js | 17 +++++++++++------ src-tauri/src/lib.rs | 3 +++ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/scripts/smoke-packaged-app.js b/scripts/smoke-packaged-app.js index 3d48b3f..f52d636 100755 --- a/scripts/smoke-packaged-app.js +++ b/scripts/smoke-packaged-app.js @@ -23,16 +23,21 @@ const stabilityMsValue = Number.parseInt(argValue('--stability-ms') || '5000', 1 const stabilityMs = Number.isFinite(stabilityMsValue) && stabilityMsValue >= 0 ? Math.min(stabilityMsValue, MAX_STABILITY_MS) : 5000; +const childEnv = { + ...process.env, + FIRELINK_SMOKE_TEST: '1', + FIRELINK_DISABLE_ARIA2_POLLER: '1', + WEBKIT_DISABLE_COMPOSITING_MODE: '1', + GDK_BACKEND: 'x11', +}; +if (process.argv.includes('--disable-aria2-poller')) { + childEnv.FIRELINK_DISABLE_ARIA2_POLLER = '1'; +} const READY_PORT_TIMEOUT_MS = 500; const child = spawn(executable, [], { cwd: process.env.RUNNER_TEMP || process.env.TMPDIR || process.cwd(), detached: process.platform !== 'win32', - env: { - ...process.env, - FIRELINK_SMOKE_TEST: '1', - WEBKIT_DISABLE_COMPOSITING_MODE: '1', - GDK_BACKEND: 'x11', - }, + env: childEnv, stdio: ['ignore', 'pipe', 'pipe'], }); diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 9edbd8f..e7f725b 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -19007,6 +19007,9 @@ pub fn run() { let poll_secret = aria2_secret.clone(); let poll_mgr = Arc::clone(&queue_manager_poll); tauri::async_runtime::spawn(async move { + if std::env::var_os("FIRELINK_DISABLE_ARIA2_POLLER").is_some() { + return; + } let mut interval = tokio::time::interval(std::time::Duration::from_millis(1000)); let mut observations: HashMap = HashMap::new(); let mut missing_gid_recovery_at: HashMap = HashMap::new();