From: Kefu Chai Date: Mon, 10 Nov 2025 15:01:32 +0000 (+0800) Subject: mgr/dashboard: fix Physical Disks identify test race condition X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F66187%2Fhead;p=ceph.git mgr/dashboard: fix Physical Disks identify test race condition Fix a regression in the Physical Disks identify device e2e test that causes intermittent timeouts when attempting to click the "Identify" button. Problem: The test was timing out after 120 seconds while attempting to click the "Identify" button, which remained in a disabled state. This manifested as a race condition where the test would try to click the button before it became enabled. Root Cause (Regression Analysis): This regression was introduced in commit 94418d90d2b ("mgr/dashboard: fix UI modal issues", Sept 9, 2024) which aimed to fix the Physical Disks Identify modal not opening (tracker.ceph.com/issues/67547). While that commit successfully: - Migrated from cd-modal to cds-modal (Carbon Design System) - Changed button selector to use data-testid="primary-action" - Added the e2e test to prevent future regressions It inadvertently introduced a timing issue by not adding proper wait logic for the button to become enabled. The commit also modified the table-actions component to conditionally render the primary action button based on tableActions.length > 0, which can cause the button to be disabled while table actions are still loading. Solution: Add .should('not.be.disabled') before .click() to ensure Cypress waits for the button to become enabled before attempting to interact with it. This follows the established pattern used elsewhere in the codebase (see page-helper.po.ts:319). Impact: - Fixes Jenkins build failures in ceph-dashboard-cephadm-e2e job - Observed in build #18956 as "Regression - Failing for 1 build" - Jenkins metrics show MTTF of ~2 hours, indicating this race condition occurs frequently enough to cause CI instability Fixes: https://jenkins.ceph.com/job/ceph-dashboard-cephadm-e2e/18956/testReport/ Signed-off-by: Kefu Chai --- diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/inventory.po.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/inventory.po.ts index 3da482cfe909..9230a26720a4 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/inventory.po.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/inventory.po.ts @@ -10,7 +10,7 @@ export class InventoryPageHelper extends PageHelper { identify() { // Nothing we can do, just verify the form is there this.getFirstTableCell().click(); - cy.contains('[data-testid="primary-action"]', 'Identify').click(); + cy.contains('[data-testid="primary-action"]', 'Identify').should('not.be.disabled').click(); cy.get('cds-modal').within(() => { cy.get('#duration').select('15 minutes'); cy.get('#duration').select('10 minutes');