Skip to content

Commit 8b3c637

Browse files
Fix flaky (#76)
Signed-off-by: bowenlan-amzn <[email protected]>
1 parent 8f3f074 commit 8b3c637

File tree

4 files changed

+26
-13
lines changed

4 files changed

+26
-13
lines changed

.github/workflows/cypress-workflow.yml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ on:
77
branches:
88
- main
99
- development-*
10-
10+
env:
11+
OPENSEARCH_DASHBOARDS_VERSION: '1.x'
12+
OPENSEARCH_VERSION: '1.1.0-SNAPSHOT'
1113
jobs:
1214
tests:
1315
name: Run Cypress E2E tests
@@ -42,7 +44,7 @@ jobs:
4244
ref: 'main'
4345
- name: Build common-utils
4446
working-directory: ./common-utils
45-
run: ./gradlew publishToMavenLocal -Dopensearch.version=1.1.0-SNAPSHOT
47+
run: ./gradlew publishToMavenLocal -Dopensearch.version=${{ env.OPENSEARCH_VERSION }}
4648
# dependencies: job-scheduler
4749
- name: Checkout job-scheduler
4850
uses: actions/checkout@v2
@@ -52,8 +54,17 @@ jobs:
5254
ref: 'main'
5355
- name: Build job-scheduler
5456
working-directory: ./job-scheduler
55-
run: ./gradlew publishToMavenLocal -Dopensearch.version=1.1.0-SNAPSHOT
56-
- name: Checkout
57+
run: ./gradlew publishToMavenLocal -Dopensearch.version=${{ env.OPENSEARCH_VERSION }}
58+
- name: Checkout alerting
59+
uses: actions/checkout@v2
60+
with:
61+
repository: 'opensearch-project/alerting'
62+
path: alerting
63+
ref: 'main'
64+
- name: Build alerting
65+
working-directory: ./alerting
66+
run: ./gradlew :alerting-notification:publishToMavenLocal -Dopensearch.version=${{ env.OPENSEARCH_VERSION }}
67+
- name: Checkout index management
5768
uses: actions/checkout@v2
5869
with:
5970
path: index-management
@@ -62,7 +73,7 @@ jobs:
6273
- name: Run opensearch with plugin
6374
run: |
6475
cd index-management
65-
./gradlew run -Dopensearch.version=1.1.0-SNAPSHOT &
76+
./gradlew run -Dopensearch.version=${{ env.OPENSEARCH_VERSION }} &
6677
sleep 300
6778
# timeout 300 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:9200)" != "200" ]]; do sleep 5; done'
6879
- name: Checkout Index Management Dashboards plugin
@@ -74,7 +85,7 @@ jobs:
7485
with:
7586
repository: opensearch-project/OpenSearch-Dashboards
7687
path: OpenSearch-Dashboards
77-
ref: '1.x'
88+
ref: ${{ env.OPENSEARCH_DASHBOARDS_VERSION }}
7889
- name: Get node and yarn versions
7990
id: versions
8091
run: |

cypress/integration/indices_spec.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@ describe("Indices", () => {
167167

168168
cy.get(`[data-test-subj="applyPolicyModalEditButton"]`).click({ force: true });
169169

170-
cy.reload();
170+
// Wait some time for apply policy to execute before reload
171+
cy.wait(3000).reload();
171172

172173
cy.contains(SAMPLE_INDEX, { timeout: 20000 });
173174

cypress/integration/managed_indices_spec.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ describe("Managed indices", () => {
3737
// Set welcome screen tracking to false
3838
localStorage.setItem("home:welcome:show", "false");
3939

40+
cy.wait(3000);
41+
4042
// Visit ISM OSD
4143
cy.visit(`${Cypress.env("opensearch_dashboards")}/app/${PLUGIN_NAME}#/managed-indices`);
4244

@@ -68,8 +70,8 @@ describe("Managed indices", () => {
6870
// Confirm we got a remove policy toaster
6971
cy.contains("Removed policy from 1 managed indices");
7072

71-
// Reload the page
72-
cy.reload();
73+
// Wait some time for remove policy to execute before reload
74+
cy.wait(3000).reload();
7375

7476
// Confirm we are back to empty loading state, give 20 seconds as OSD takes a while to load
7577
cy.contains("There are no existing managed indices.", { timeout: 20000 });
@@ -198,8 +200,7 @@ describe("Managed indices", () => {
198200
.type(SAMPLE_INDEX, { parseSpecialCharSequences: false, delay: 1 });
199201

200202
// Click the index option
201-
// TODO flaky: Seems sometime click not actually select the option...
202-
cy.get(`button[title="${SAMPLE_INDEX}"]`).dblclick().debug();
203+
cy.get(`button[title="${SAMPLE_INDEX}"]`).trigger("click", { force: true });
203204

204205
// Get the third combo search input box which should be the policy input
205206
cy.get(`input[data-test-subj="comboBoxSearchInput"]`).eq(2).focus().type(POLICY_ID_2, { parseSpecialCharSequences: false, delay: 1 });

cypress/integration/rollups_spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,13 +237,13 @@ describe("Rollups", () => {
237237
cy.contains(`${ROLLUP_ID}`);
238238

239239
// Click Disable button
240-
cy.get(`[data-test-subj="disableButton"]`).click({ force: true });
240+
cy.get(`[data-test-subj="disableButton"]`).trigger("click", { force: true });
241241

242242
// Confirm we get toaster saying rollup job is disabled
243243
cy.contains(`${ROLLUP_ID} is disabled`);
244244

245245
// Click Enable button
246-
cy.get(`[data-test-subj="enableButton"]`).click({ force: true });
246+
cy.get(`[data-test-subj="enableButton"]`).trigger("click", { force: true });
247247

248248
// Confirm we get toaster saying rollup job is enabled
249249
cy.contains(`${ROLLUP_ID} is enabled`);

0 commit comments

Comments
 (0)