]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: fix Physical Disks identify test race condition 66187/head
authorKefu Chai <k.chai@proxmox.com>
Mon, 10 Nov 2025 15:01:32 +0000 (23:01 +0800)
committerKefu Chai <k.chai@proxmox.com>
Tue, 11 Nov 2025 09:14:03 +0000 (17:14 +0800)
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 <k.chai@proxmox.com>
src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/inventory.po.ts

index 3da482cfe9095eeb8a15be8bb3b997cd06e41967..9230a26720a4ad02f7d7392bfb5f3ab949f7357c 100644 (file)
@@ -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');