From db5cfb15e55dadf7bd5c381f53a4ea548fcea152 Mon Sep 17 00:00:00 2001 From: Nizamudeen A Date: Thu, 7 Oct 2021 21:06:29 +0530 Subject: [PATCH] mgr/dashboard: Fix orchestrator/01-hosts.e2e-spec.ts failure 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 --- .../integration/orchestrator/01-hosts.e2e-spec.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/01-hosts.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/01-hosts.e2e-spec.ts index cf85642a1b1d2..db72ddbd396cd 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/01-hosts.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/integration/orchestrator/01-hosts.e2e-spec.ts @@ -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 -- 2.39.5