Skip to content

Commit

Permalink
Fix flaky tests in core dashboard. (#1371)
Browse files Browse the repository at this point in the history
* feat: troubleshoot

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: troubleshoot

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: troubleshoot

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: troubleshoot

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: troubleshoot

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: troubleshoot

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: troubleshoot

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: troubleshoot

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: troubleshoot

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: troubleshoot

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: troubleshoot

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: troubleshoot

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: troubleshoot

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: troubleshoot

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: troubleshoot

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: troubleshoot

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: troubleshoot

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: troubleshoot

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: troubleshoot

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: troubleshoot

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: troubleshoot

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: troubleshoot

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: troubleshoot

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: troubleshoot

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: troubleshoot

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: troubleshoot

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: troubleshoot

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: troubleshoot

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: troubleshoot

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: troubleshoot

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: troubleshoot

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: troubleshoot

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* fix: discover advanced settings

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* fix: discover tabe spec

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* troubleshoot

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* troubleshoot

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

---------

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
  • Loading branch information
SuZhou-Joe authored Jun 12, 2024
1 parent 8c3ac2f commit 5af3c7a
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ on:
- '.github/workflows/cypress-workflow-bundle-snapshot-based-ci-groups.yml'
- 'cypress/**/core-opensearch-dashboards/**'
- 'cypress/utils/dashboards/**'
- 'package.json'
push:
branches: ['**']
paths:
- '.github/workflows/cypress-workflow-bundle-snapshot-based-ci-groups.yml'
- 'cypress/**/core-opensearch-dashboards/**'
- 'cypress/utils/dashboards/**'
- 'package.json'

env:
CI_GROUPS: "1,2,3,4,5,6,7,8,9"
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/cypress-workflow-bundle-snapshot-based.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
name: Bundle Snapshot based E2E Cypress tests workflow for core Dashboards
on:
pull_request:
branches: [ '**' ]
branches: ['**']
paths:
- 'cypress/**/core-opensearch-dashboards/**'
- 'cypress/utils/dashboards/**'
- '.github/workflows/cypress-workflow-bundle-snapshot-based.yml'
push:
branches: [ '**' ]
branches: ['**']
paths:
- 'cypress/**/core-opensearch-dashboards/**'
- 'cypress/utils/dashboards/**'
- '.github/workflows/cypress-workflow-bundle-snapshot-based.yml'

jobs:
tests-with-security:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ describe('discover_advanced_setting', () => {
it('check legacy table respects Number of rows setting', function () {
cy.switchDiscoverTable('legacy');
cy.wait(2000); // Intentional Wait to account for low performant env
cy.get('[aria-label="Next"]').should('have.length', 5);
cy.get('[aria-label="Toggle row details"]').should('have.length', 5);
});

after(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ describe('discover histogram', { scrollBehavior: false }, () => {
);
cy.deleteIndex('long-window-logstash-0');
cy.deleteSavedObjectByType('index-pattern');
cy.clearCache();
});

it('should visualize monthly data with different day intervals', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,7 @@ describe('discover_table', () => {
cy.reload();
cy.deleteIndexPattern('nestedindex');
cy.deleteIndex('nestedindex');
cy.clearCache();
miscUtils.visitPage(
`app/data-explorer/discover#/?_g=(filters:!(),time:(from:'2015-09-19T13:31:44.000Z',to:'2015-09-24T01:31:44.000Z'))`
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ describe('shared links', () => {
cy.fleshTenantSettings();
});

after(() => {
cy.deleteIndex(indexSet.join(','));
cy.clearCache();
});

describe('shared links with state in query', () => {
it('should allow for copying the snapshot URL', function () {
const url = `http://localhost:5601/app/data-explorer/discover#/?_a=(discover:(columns:!(_source),isDirty:!f,sort:!()),metadata:(indexPattern:'logstash-*',view:discover))&_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:'2015-09-19T13:31:44.000Z',to:'2015-09-24T01:31:44.000Z'))&_q=(filters:!(),query:(language:kuery,query:''))`;
Expand Down Expand Up @@ -125,9 +130,9 @@ describe('shared links', () => {
});

after(() => {
cy.setAdvancedSetting({
'state:storeStateInSessionStorage': false,
});
CURRENT_TENANT.newTenant = 'global';
cy.fleshTenantSettings();
cy.deleteSavedObjectByType('config');
});

it('should allow for copying the snapshot URL', function () {
Expand Down
8 changes: 8 additions & 0 deletions cypress/utils/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

import { BASE_PATH, IM_API, BACKEND_BASE_PATH } from './constants';
import { devToolsRequest } from './helpers';

export const DisableLocalCluster = !!Cypress.env('DISABLE_LOCAL_CLUSTER'); // = hideLocalCluster

Expand Down Expand Up @@ -655,3 +656,10 @@ Cypress.Commands.add('removeSampleDataFromDataSource', (dataSourceTitle) => {
.should('be.visible')
.click();
});

Cypress.Commands.add('clearCache', () => {
devToolsRequest(`/_cache/clear?query=true&request=true`, 'POST');
devToolsRequest(`/_flush`, 'POST');
devToolsRequest(`/_forcemerge`, 'POST');
cy.wait(5000);
});

0 comments on commit 5af3c7a

Please sign in to comment.