Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Flaky Discover Table Tests #1377

Merged
merged 1 commit into from
Jun 12, 2024

Conversation

LDrago27
Copy link
Contributor

@LDrago27 LDrago27 commented Jun 11, 2024

Description

Fix Flaky tests in Discover Table.

Without Security

discover_table.spec.js.mp4

With Security

discover_table.spec.js.mp4

Check List

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

);
cy.waitForLoader();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did you change this? wait for loader is more reliable since it waits for a specific element and not just the an arbitrary time which can cause the test to become flakey

Copy link
Contributor Author

@LDrago27 LDrago27 Jun 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While running the tests, I found that waiting for page load didn't make sense in few occasions. While applying the filter to a table the entire page doesn't reload. In those scenarios(using waitForLoader) instead of waiting for the number of entires to change in table , cypress picks up the older table result and the evaluation condition fails.
To avoid such scenarios I have put a wait time.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ashwin-pc Updated the PR to remove waits, instead added verification for hits which has resolved the previous issues.

Signed-off-by: Suchit Sahoo <suchsah@amazon.com>
@peterzhuamazon peterzhuamazon merged commit c8cbf04 into opensearch-project:main Jun 12, 2024
38 of 43 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jun 12, 2024
Signed-off-by: Suchit Sahoo <suchsah@amazon.com>
(cherry picked from commit c8cbf04)
peterzhuamazon pushed a commit that referenced this pull request Jun 12, 2024
Signed-off-by: Suchit Sahoo <suchsah@amazon.com>
(cherry picked from commit c8cbf04)

Co-authored-by: Suchit Sahoo <38322563+LDrago27@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants