From 90e8c60f213a8cb351406a5d0ee02cb8203a61e6 Mon Sep 17 00:00:00 2001 From: vikhy-aws <191836418+vikhy-aws@users.noreply.github.com> Date: Mon, 6 Jan 2025 18:08:24 -0800 Subject: [PATCH] fix: update timeout for monitor creation to 60secs to handle failing cypress test Signed-off-by: vikhy-aws <191836418+vikhy-aws@users.noreply.github.com> --- cypress/integration/acknowledge_alerts_modal_spec.js | 4 ++-- cypress/support/commands.js | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/cypress/integration/acknowledge_alerts_modal_spec.js b/cypress/integration/acknowledge_alerts_modal_spec.js index fd98cc32..4b1a5a47 100644 --- a/cypress/integration/acknowledge_alerts_modal_spec.js +++ b/cypress/integration/acknowledge_alerts_modal_spec.js @@ -46,8 +46,8 @@ describe('AcknowledgeAlertsModal', () => { cy.visit(`${Cypress.env('opensearch_dashboards')}/app/${PLUGIN_NAME}#/dashboard`); // Confirm dashboard is displaying rows for the test monitors. - cy.contains(BUCKET_MONITOR, { timeout: TWENTY_SECONDS }); - cy.contains(QUERY_MONITOR, { timeout: TWENTY_SECONDS }); + cy.contains(BUCKET_MONITOR, { timeout: SIXTY_SECONDS }); + cy.contains(QUERY_MONITOR, { timeout: SIXTY_SECONDS }); }); it('Acknowledge button disabled when more than 1 trigger selected', () => { diff --git a/cypress/support/commands.js b/cypress/support/commands.js index c2b0a257..ca8c8197 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ +const { method } = require('lodash'); const { API, ADMIN_AUTH } = require('./constants'); // *********************************************** @@ -71,7 +72,12 @@ Cypress.Commands.overwrite('request', (originalFn, ...args) => { }); Cypress.Commands.add('createMonitor', (monitorJSON) => { - cy.request('POST', `${Cypress.env('opensearch')}${API.MONITOR_BASE}`, monitorJSON); + cy.request({ + method: 'POST', + url: `${Cypress.env('opensearch')}${API.MONITOR_BASE}`, + body: monitorJSON, + timeout: 60000 + }); }); Cypress.Commands.add('createAndExecuteMonitor', (monitorJSON) => {