Skip to content

Commit b533de7

Browse files
committed
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 94418d9 ("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 ceph#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 <[email protected]>
1 parent b56fccc commit b533de7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/inventory.po.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export class InventoryPageHelper extends PageHelper {
1010
identify() {
1111
// Nothing we can do, just verify the form is there
1212
this.getFirstTableCell().click();
13-
cy.contains('[data-testid="primary-action"]', 'Identify').click();
13+
cy.contains('[data-testid="primary-action"]', 'Identify').should('not.be.disabled').click();
1414
cy.get('cds-modal').within(() => {
1515
cy.get('#duration').select('15 minutes');
1616
cy.get('#duration').select('10 minutes');

0 commit comments

Comments
 (0)