From 8d294b2e8c2aa49837c36b3055b7eec9af3547fc Mon Sep 17 00:00:00 2001 From: Dylan Hurd Date: Mon, 4 May 2026 14:54:28 -0400 Subject: [PATCH] test(plugins): expect retained inactive versions --- .../app-server/tests/suite/v2/plugin_list.rs | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/codex-rs/app-server/tests/suite/v2/plugin_list.rs b/codex-rs/app-server/tests/suite/v2/plugin_list.rs index 6bcefbb588..709298cad8 100644 --- a/codex-rs/app-server/tests/suite/v2/plugin_list.rs +++ b/codex-rs/app-server/tests/suite/v2/plugin_list.rs @@ -1441,6 +1441,9 @@ async fn plugin_list_sync_upgrades_and_removes_remote_installed_plugin_bundles() let new_path = codex_home .path() .join("plugins/cache/chatgpt-global/linear/1.2.3"); + let active_version_marker = codex_home + .path() + .join("plugins/cache/chatgpt-global/linear/.active-version"); let stale_path = codex_home.path().join("plugins/cache/chatgpt-global/stale"); let mut mcp = McpProcess::new_with_env( @@ -1477,7 +1480,22 @@ async fn plugin_list_sync_upgrades_and_removes_remote_installed_plugin_bundles() ); wait_for_path_exists(&new_path.join(".codex-plugin/plugin.json")).await?; - wait_for_path_missing(&old_path).await?; + timeout(DEFAULT_TIMEOUT, async { + loop { + if matches!( + std::fs::read_to_string(&active_version_marker).as_deref(), + Ok("1.2.3\n") + ) { + return Ok::<(), anyhow::Error>(()); + } + tokio::time::sleep(Duration::from_millis(10)).await; + } + }) + .await??; + assert!( + old_path.join(".codex-plugin/plugin.json").is_file(), + "inactive old plugin version should remain until later cleanup" + ); wait_for_path_missing(&stale_path).await?; let config = std::fs::read_to_string(codex_home.path().join("config.toml"))?; assert!(!config.contains("linear@chatgpt-global"));