]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Fix orchestrator/01-hosts.e2e-spec.ts failure 43453/head
authorNizamudeen A <nia@redhat.com>
Thu, 7 Oct 2021 15:36:29 +0000 (21:06 +0530)
committerNizamudeen A <nia@redhat.com>
Tue, 12 Oct 2021 15:00:12 +0000 (20:30 +0530)
The test is failing on deleting a host because the agent daemon is
present in that host. Its not possible to simply delete a host. We need
to drain it first and then delete it.

Fixes: https://tracker.ceph.com/issues/52764
Signed-off-by: Nizamudeen A <nia@redhat.com>
src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/01-hosts.e2e-spec.ts

index cf85642a1b1d2ef997d10bb9e65f1bed895998a5..db72ddbd396cd4dea0fe6eb20f91c13cf799bf9a 100644 (file)
@@ -21,8 +21,20 @@ describe('Hosts page', () => {
       hosts.add(hostname, true);
     });
 
-    it('should delete a host and add it back', function () {
+    it('should drain and delete a host and then add it back', function () {
       const host = Cypress._.last(this.hosts)['name'];
+
+      // should drain the host first before deleting
+      hosts.editLabels(host, ['_no_schedule'], true);
+      hosts.clickHostTab(host, 'Daemons');
+      cy.get('cd-host-details').within(() => {
+        // draining will take some time to complete.
+        // since we don't know how many daemons will be
+        // running in this host in future putting the wait
+        // to 15s
+        cy.wait(15000);
+        hosts.getTableCount('total').should('be.eq', 0);
+      });
       hosts.delete(host);
 
       // add it back