From b7a8f85530ae7ac14c6c6ec721c14a522121975e Mon Sep 17 00:00:00 2001 From: "Dr.Lt.Data" Date: Sat, 8 Nov 2025 15:22:02 +0900 Subject: [PATCH] test: fix test isolation in test_installed_api_no_duplicates_across_scenarios MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix sequential scenario test that was failing in Env 9 due to improper state management between scenarios. Root Cause: In scenario "CNR enabled + Nightly disabled": 1. Install Nightly → auto-disables CNR 2. Disable Nightly → both packages now disabled 3. Test expects: CNR enabled, Nightly disabled 4. Actual state: both disabled (CNR not re-enabled) Fix: Added enable operation after disabling Nightly to restore CNR to enabled state. This ensures the scenario accurately represents "CNR enabled + Nightly disabled" instead of leaving both packages disabled. Changes: - Added enable CNR operation after disabling Nightly in scenario 2 - Updated ui_id to be more descriptive (disable_nightly, enable_cnr) - Ensures proper state transition: both enabled → Nightly disabled → CNR re-enabled Test Results: - Before: 9/10 environments passing (90%) - After: 10/10 environments passing (100%) - All 63 tests passing across all environments Session Progress: - Session start: 7/10 environments (60/63 tests) - After parameter fix: 9/10 environments (62/63 tests) - Final: 10/10 environments (63/63 tests ✅) - Total improvement: +3 environments, +3 tests (+42.9%) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../glob/test_installed_api_enabled_priority.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tests/glob/test_installed_api_enabled_priority.py b/tests/glob/test_installed_api_enabled_priority.py index 7b9ed2e7..dc0529d7 100644 --- a/tests/glob/test_installed_api_enabled_priority.py +++ b/tests/glob/test_installed_api_enabled_priority.py @@ -299,7 +299,7 @@ def test_installed_api_no_duplicates_across_scenarios( time.sleep(WAIT_TIME_MEDIUM) elif scenario_id == "cnr_enabled_nightly_disabled": - # Install Nightly then disable it + # Install Nightly (this auto-disables CNR), then disable Nightly, then enable CNR response = api_client.queue_task( kind="install", ui_id=f"test_{scenario_id}_nightly", @@ -314,9 +314,10 @@ def test_installed_api_no_duplicates_across_scenarios( assert response.status_code in [200, 201] time.sleep(WAIT_TIME_MEDIUM) + # Disable Nightly response = api_client.queue_task( kind="disable", - ui_id=f"test_{scenario_id}_disable", + ui_id=f"test_{scenario_id}_disable_nightly", params={"node_name": TEST_PACKAGE_ID}, ) assert response.status_code == 200 @@ -324,6 +325,17 @@ def test_installed_api_no_duplicates_across_scenarios( assert response.status_code in [200, 201] time.sleep(WAIT_TIME_MEDIUM) + # Re-enable CNR (which was auto-disabled when Nightly was installed) + response = api_client.queue_task( + kind="enable", + ui_id=f"test_{scenario_id}_enable_cnr", + params={"cnr_id": TEST_PACKAGE_ID}, + ) + assert response.status_code == 200 + response = api_client.start_queue() + assert response.status_code in [200, 201] + time.sleep(WAIT_TIME_MEDIUM) + elif scenario_id == "nightly_enabled_cnr_disabled": # CNR should already be disabled from previous scenario # Enable Nightly (install if not exists)