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

Improve Observability Panels Tests #1006

Merged
merged 2 commits into from
Feb 4, 2024
Merged

Conversation

sejli
Copy link
Member

@sejli sejli commented Jan 23, 2024

Description

Improving flaky panels tests by removing most unnecessary waits, adding a longer timeout for page to load. Also added a check for the second test

Issues Resolved

#897

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.

Signed-off-by: Sean Li <lnse@amazon.com>
@ruanyl
Copy link
Member

ruanyl commented Jan 26, 2024

Hi @sejli, the github workflow for observability failed always, could you take a look at please? It looks like it reached 6h time limit. https://github.com/opensearch-project/opensearch-dashboards-functional-test/actions/runs/7630376041/job/20841331694?pr=1006

@sejli
Copy link
Member Author

sejli commented Jan 26, 2024

Hey @ruanyl, thanks for taking a look. I went through the GitHub actions logs, seems like it just gets stuck on 1_trace_analytics_dashboard.spec.js which causes it to run for the maximum 6 hours. I tried downloading the .mp4 artifact as well, but the video is corrupted on my side.

  Testing dashboard table
    ✓ Adds the percentile filters (22886ms)

Did some digging through other GitHub action runs, looks like there's a few more PRs here and here that are experiencing the same timeout issue. According to @SuZhou-Joe, this is a Cypress issue with Chrome, and I'll attach a local run of the test as a workaround.

Chrome (a lot slower)

% yarn cypress:run-without-security --browser chrome --spec 'cypress/integration/plugins/observability-dashboards/4_panels.spec.js'
yarn run v1.22.21
$ env TZ=America/Los_Angeles NO_COLOR=1 cypress run --headless --env SECURITY_ENABLED=false --browser chrome --spec cypress/integration/plugins/observability-dashboards/4_panels.spec.js

====================================================================================================

  (Run Starting)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Cypress:        9.5.4                                                                          │
  │ Browser:        Chrome 120 (headless)                                                          │
  │ Node Version:   v14.20.0 (/Users/lnse/.nvm/versions/node/v14.20.0/bin/node)                    │
  │ Specs:          1 found (plugins/observability-dashboards/4_panels.spec.js)                    │
  │ Searched:       cypress/integration/plugins/observability-dashboards/4_panels.spec.js          │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘


────────────────────────────────────────────────────────────────────────────────────────────────────
                                                                                                    
  Running:  plugins/observability-dashboards/4_panels.spec.js                               (1 of 1)
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating


  Testing panels table
    ✓ Creates a panel and redirects to the panel (99704ms)
    ✓ Duplicates a panel (66118ms)


  2 passing (3m)


  (Results)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Tests:        2                                                                                │
  │ Passing:      2                                                                                │
  │ Failing:      0                                                                                │
  │ Pending:      0                                                                                │
  │ Skipped:      0                                                                                │
  │ Screenshots:  0                                                                                │
  │ Video:        true                                                                             │
  │ Duration:     2 minutes, 48 seconds                                                            │
  │ Spec Ran:     plugins/observability-dashboards/4_panels.spec.js                                │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘


  (Video)

  -  Started processing:  Compressing to 32 CRF                                                     
  -  Finished processing: /Users/lnse/opensearch/opensearch-dashboards-functional-tes    (8 seconds)
                          t/cypress/videos/plugins/observability-dashboards/4_panels.               
                          spec.js.mp4                                                               


====================================================================================================

  (Run Finished)


       Spec                                              Tests  Passing  Failing  Pending  Skipped  
  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ ✔  plugins/observability-dashboards/4_      02:48        2        2        -        -        - │
  │    panels.spec.js                                                                              │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘
    ✔  All specs passed!                        02:48        2        2        -        -        -  

✨  Done in 201.38s.

Electron

% yarn cypress:run-without-security --spec 'cypress/integration/plugins/observability-dashboards/4_panels.spec.js'
yarn run v1.22.21
$ env TZ=America/Los_Angeles NO_COLOR=1 cypress run --headless --env SECURITY_ENABLED=false --spec cypress/integration/plugins/observability-dashboards/4_panels.spec.js

====================================================================================================

  (Run Starting)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Cypress:        9.5.4                                                                          │
  │ Browser:        Electron 94 (headless)                                                         │
  │ Node Version:   v14.20.0 (/Users/lnse/.nvm/versions/node/v14.20.0/bin/node)                    │
  │ Specs:          1 found (plugins/observability-dashboards/4_panels.spec.js)                    │
  │ Searched:       cypress/integration/plugins/observability-dashboards/4_panels.spec.js          │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘


────────────────────────────────────────────────────────────────────────────────────────────────────
                                                                                                    
  Running:  plugins/observability-dashboards/4_panels.spec.js                               (1 of 1)
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating


  Testing panels table
    ✓ Creates a panel and redirects to the panel (16371ms)
    ✓ Duplicates a panel (5723ms)


  2 passing (22s)


  (Results)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Tests:        2                                                                                │
  │ Passing:      2                                                                                │
  │ Failing:      0                                                                                │
  │ Pending:      0                                                                                │
  │ Skipped:      0                                                                                │
  │ Screenshots:  0                                                                                │
  │ Video:        true                                                                             │
  │ Duration:     22 seconds                                                                       │
  │ Spec Ran:     plugins/observability-dashboards/4_panels.spec.js                                │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘


  (Video)

  -  Started processing:  Compressing to 32 CRF                                                     
  -  Finished processing: /Users/lnse/opensearch/opensearch-dashboards-functional-tes     (1 second)
                          t/cypress/videos/plugins/observability-dashboards/4_panels.               
                          spec.js.mp4                                                               


====================================================================================================

  (Run Finished)


       Spec                                              Tests  Passing  Failing  Pending  Skipped  
  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ ✔  plugins/observability-dashboards/4_      00:22        2        2        -        -        - │
  │    panels.spec.js                                                                              │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘
    ✔  All specs passed!                        00:22        2        2        -        -        -  

✨  Done in 43.67s.

@ruanyl
Copy link
Member

ruanyl commented Jan 29, 2024

Hi @sejli, thanks for looking into this, approved now.

@wanglam
Copy link
Collaborator

wanglam commented Feb 1, 2024

Hi @sejli , do we need to backport these changes to 2.x branch?

@sejli
Copy link
Member Author

sejli commented Feb 1, 2024

Hi @wanglam, yes, these changes should also be backported to 2.x branch. Thanks!

@wanglam wanglam merged commit abb5701 into opensearch-project:main Feb 4, 2024
38 of 39 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Feb 4, 2024
Signed-off-by: Sean Li <lnse@amazon.com>
(cherry picked from commit abb5701)
ruanyl pushed a commit that referenced this pull request Feb 5, 2024
Signed-off-by: Sean Li <lnse@amazon.com>
(cherry picked from commit abb5701)

Co-authored-by: Sean Li <lnse@amazon.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.

3 participants