]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: fix flaky inventory e2e test 44056/head
authorNizamudeen A <nia@redhat.com>
Thu, 18 Nov 2021 07:13:39 +0000 (12:43 +0530)
committerNizamudeen A <nia@redhat.com>
Tue, 23 Nov 2021 06:04:07 +0000 (11:34 +0530)
When `inventory.getTableCount('total').should('be.eq', totalDiskCount);`
this line is executed the table was not loaded properly and hence the
getTableCount returns 0 on the first try but on second try it passes
since the table is loaded. But in orch e2es the retries are set to 0. I
am not sure if it makes sense to set it to 1. Anyway I am adapting the
test a bit to expect the count to be equal to totalDiskCount so that the
test will wait a bit.

Fixes: https://tracker.ceph.com/issues/53353
Signed-off-by: Nizamudeen A <nia@redhat.com>
(cherry picked from commit cdce5f78ad4a9f4a91837322b83cee89a393a0ca)

src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/03-inventory.e2e-spec.ts

index 24a1b89178d25f1179fb72b3b695ff0a7791f9fb..a64e3bc8c020fca69f36cdd57890beee5d85ffb6 100644 (file)
@@ -12,7 +12,7 @@ describe('Physical Disks page', () => {
   it('should have correct devices', () => {
     cy.fixture('orchestrator/inventory.json').then((hosts) => {
       const totalDiskCount = Cypress._.sumBy(hosts, 'devices.length');
-      inventory.getTableCount('total').should('be.eq', totalDiskCount);
+      inventory.expectTableCount('total', totalDiskCount);
       for (const host of hosts) {
         inventory.filterTable('Hostname', host['name']);
         inventory.getTableCount('found').should('be.eq', host.devices.length);