From f7d559e81fae5f0f57d1f97398af11dbffd8f30b Mon Sep 17 00:00:00 2001 From: Prabhat Sharma Date: Wed, 19 Jun 2024 20:36:52 +0530 Subject: [PATCH] Fix: flaky tests for v2.15 Signed-off-by: Prabhat Sharma --- .../plugins/index-management-dashboards-plugin/aliases.js | 2 +- .../index-management-dashboards-plugin/data_streams.js | 2 +- .../index-management-dashboards-plugin/indices_spec.js | 4 ++-- .../index-management-dashboards-plugin/rollups_spec.js | 2 +- .../index-management-dashboards-plugin/transforms_spec.js | 3 +++ 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/cypress/integration/plugins/index-management-dashboards-plugin/aliases.js b/cypress/integration/plugins/index-management-dashboards-plugin/aliases.js index e91e2d710..69e0a2751 100644 --- a/cypress/integration/plugins/index-management-dashboards-plugin/aliases.js +++ b/cypress/integration/plugins/index-management-dashboards-plugin/aliases.js @@ -167,7 +167,7 @@ describe('Aliases', () => { ); let num = response_obj['_all']['total']['translog']['uncommitted_operations']; - expect(num).to.equal(1); + expect(num).not.equal(0); }); cy.get('[data-test-subj="moreAction"]').click(); diff --git a/cypress/integration/plugins/index-management-dashboards-plugin/data_streams.js b/cypress/integration/plugins/index-management-dashboards-plugin/data_streams.js index cf99f2c06..f84f6570c 100644 --- a/cypress/integration/plugins/index-management-dashboards-plugin/data_streams.js +++ b/cypress/integration/plugins/index-management-dashboards-plugin/data_streams.js @@ -110,7 +110,7 @@ describe('Data stream', () => { ); let num = response_obj['_all']['total']['translog']['uncommitted_operations']; - expect(num).to.equal(1); + expect(num).not.equal(0); }); cy.get('[data-test-subj="moreAction"]').click(); diff --git a/cypress/integration/plugins/index-management-dashboards-plugin/indices_spec.js b/cypress/integration/plugins/index-management-dashboards-plugin/indices_spec.js index b0de7ef1c..aff18aef6 100644 --- a/cypress/integration/plugins/index-management-dashboards-plugin/indices_spec.js +++ b/cypress/integration/plugins/index-management-dashboards-plugin/indices_spec.js @@ -628,7 +628,7 @@ describe('Indices', () => { ); let num = response_obj['_all']['total']['translog']['uncommitted_operations']; - expect(num).to.equal(1); + expect(num).not.equal(0); }); // Select an index @@ -688,7 +688,7 @@ describe('Indices', () => { ); let num = response_obj['_all']['total']['translog']['uncommitted_operations']; - expect(num).to.equal(1); + expect(num).not.equal(0); }); cy.get('[data-test-subj="moreAction"]').click(); diff --git a/cypress/integration/plugins/index-management-dashboards-plugin/rollups_spec.js b/cypress/integration/plugins/index-management-dashboards-plugin/rollups_spec.js index 4210d4e66..18be5332d 100644 --- a/cypress/integration/plugins/index-management-dashboards-plugin/rollups_spec.js +++ b/cypress/integration/plugins/index-management-dashboards-plugin/rollups_spec.js @@ -17,7 +17,7 @@ describe('Rollups', () => { cy.visit(`${BASE_PATH}/app/home#/tutorial_directory/sampleData`); // Click on "Sample data" tab - cy.contains('Sample data').click({ force: true }); + cy.contains('Sample data', { timeout: 60000 }).click({ force: true }); // Load sample eCommerce data cy.get(`button[data-test-subj="addSampleDataSetecommerce"]`).click({ force: true, diff --git a/cypress/integration/plugins/index-management-dashboards-plugin/transforms_spec.js b/cypress/integration/plugins/index-management-dashboards-plugin/transforms_spec.js index 0b097ff54..126c50f03 100644 --- a/cypress/integration/plugins/index-management-dashboards-plugin/transforms_spec.js +++ b/cypress/integration/plugins/index-management-dashboards-plugin/transforms_spec.js @@ -266,6 +266,9 @@ describe('Transforms', () => { .should('not.be.disabled') .click(); + // Extra wait to reduce the possibility of version conflict exception + cy.wait(2000); + cy.wait('@stopTransform'); cy.wait('@getTransform');