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 Dashboards Visualization Tests #1187

Merged
merged 6 commits into from
Mar 29, 2024

Conversation

sejli
Copy link
Member

@sejli sejli commented Mar 28, 2024

Description

Refactor dashboards-visualization flaky tests

Issues Resolved

#354

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.

beforeEach(() => {
CURRENT_TENANT.newTenant = 'private';
Copy link
Member

Choose a reason for hiding this comment

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

Any reason we switch to a private tenant?

Copy link
Member Author

Choose a reason for hiding this comment

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

Switching to private tenant since some tests are flaky due to tennant popup. For some reason, setting it to global resulted in our target index not being found.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm, switched over to global but it looks like the popup still stays there on the first test Create and saves a gantt chart. @SuZhou-Joe, any ideas on why the popup still shows up even after setting the tenant, and only on the first test?

Copy link
Member

Choose a reason for hiding this comment

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

Not familiar with the tenant popup either. @kavilla Do you know how to hide the tenant popup?

@SuZhou-Joe
Copy link
Member

backport 2.13 needed?

Signed-off-by: Sean Li <[email protected]>
@sejli
Copy link
Member Author

sejli commented Mar 28, 2024

backport 2.13 needed?

Yup, need to get this backported to 2.13 so the integ tests can pass for the build.

@SuZhou-Joe
Copy link
Member

@sejli I rebase the branch but the gant cases still failed. Could you please share the result in your local env?

@sejli
Copy link
Member Author

sejli commented Mar 28, 2024

@sejli I rebase the branch but the gant cases still failed. Could you please share the result in your local env?

Sure, here's a the video from my latest run. I'm running with the latest 2.13 release candidates and the command I used was

➜ opensearch-dashboards-functional-test (gantt-charts-fix) ✗ yarn cypress:run-with-security --browser chrome --spec 'cypress/integration/plugins/gantt-chart-dashboards/gantt_ui.spec.js'
yarn run v1.22.21
$ env TZ=America/Los_Angeles NO_COLOR=1 cypress run --headless --env SECURITY_ENABLED=true,openSearchUrl=https://localhost:9200,WAIT_FOR_LOADER_BUFFER_MS=500 --browser chrome --spec cypress/integration/plugins/gantt-chart-dashboards/gantt_ui.spec.js

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

  (Run Starting)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Cypress:        9.5.4                                                                          │
  │ Browser:        Chrome 123 (headless)                                                          │
  │ Node Version:   v18.16.0 (/Users/lnse/.nvm/versions/node/v18.16.0/bin/node)                    │
  │ Specs:          1 found (plugins/gantt-chart-dashboards/gantt_ui.spec.js)                      │
  │ Searched:       cypress/integration/plugins/gantt-chart-dashboards/gantt_ui.spec.js            │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘


────────────────────────────────────────────────────────────────────────────────────────────────────
                                                                                                    
  Running:  plugins/gantt-chart-dashboards/gantt_ui.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


  Dump test data
    ✓ Indexes test data for gantt chart

  Save a gantt chart
    ✓ Creates and saves a gantt chart (20523ms)

  Render and configure a gantt chart
    ✓ Renders no data message (6562ms)
    ✓ Renders the chart (6098ms)

  Configure panel settings
    ✓ Changes y-axis label (5716ms)
    ✓ Changes x-axis label (5102ms)
    ✓ Changes time formats (6192ms)
    ✓ Hides legends (7365ms)

  Add gantt chart to dashboard
    ✓ Adds gantt chart to dashboard


  9 passing (1m)


  (Results)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Tests:        9                                                                                │
  │ Passing:      9                                                                                │
  │ Failing:      0                                                                                │
  │ Pending:      0                                                                                │
  │ Skipped:      0                                                                                │
  │ Screenshots:  0                                                                                │
  │ Video:        true                                                                             │
  │ Duration:     1 minute, 2 seconds                                                              │
  │ Spec Ran:     plugins/gantt-chart-dashboards/gantt_ui.spec.js                                  │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘


  (Video)

  -  Started processing:  Compressing to 32 CRF                                                     
  -  Finished processing: /Users/lnse/opensearch/opensearch-dashboards-functional-tes    (4 seconds)
                          t/cypress/videos/plugins/gantt-chart-dashboards/gantt_ui.sp               
                          ec.js.mp4                                                                 


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

  (Run Finished)


       Spec                                              Tests  Passing  Failing  Pending  Skipped  
  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ ✔  plugins/gantt-chart-dashboards/gant      01:02        9        9        -        -        - │
  │    t_ui.spec.js                                                                                │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘
    ✔  All specs passed!                        01:02        9        9        -        -        -  

✨  Done in 81.80s.
gantt_ui.spec.js.mp4

@sejli
Copy link
Member Author

sejli commented Mar 28, 2024

I switched to global tenant following PR #1073. Despite setting to global tenant, I noticed that in both of our recorded videos run by GitHub (theirs for reference), the tenant icon in the top right is still the admin icon. I can see that the URL includes the security tenant being set to global. However, the Creates and saves a gantt chart is still stuck on the popup.

@SuZhou-Joe SuZhou-Joe merged commit 4faa0c9 into opensearch-project:main Mar 29, 2024
37 of 38 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 29, 2024
* fixing gantt chart flaky tests

Signed-off-by: Sean Li <[email protected]>

* removing comments

Signed-off-by: Sean Li <[email protected]>

* try global tenant

Signed-off-by: Sean Li <[email protected]>

* try global tenant in before hook

Signed-off-by: Sean Li <[email protected]>

---------

Signed-off-by: Sean Li <[email protected]>
(cherry picked from commit 4faa0c9)
opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 29, 2024
* fixing gantt chart flaky tests

Signed-off-by: Sean Li <[email protected]>

* removing comments

Signed-off-by: Sean Li <[email protected]>

* try global tenant

Signed-off-by: Sean Li <[email protected]>

* try global tenant in before hook

Signed-off-by: Sean Li <[email protected]>

---------

Signed-off-by: Sean Li <[email protected]>
(cherry picked from commit 4faa0c9)
@SuZhou-Joe
Copy link
Member

image It seems the tenant popup is still there.

@sejli
Copy link
Member Author

sejli commented Mar 29, 2024

Yes, that was the original issue I kept bringing up here and here

Hmm, switched over to global but it looks like the popup still stays there on the first test Create and saves a gantt chart. @SuZhou-Joe, any ideas on why the popup still shows up even after setting the tenant, and only on the first test?

I can see that the URL includes the security tenant being set to global. However, the Creates and saves a gantt chart is still stuck on the popup.

SuZhou-Joe pushed a commit that referenced this pull request Mar 29, 2024
* fixing gantt chart flaky tests

Signed-off-by: Sean Li <[email protected]>

* removing comments

Signed-off-by: Sean Li <[email protected]>

* try global tenant

Signed-off-by: Sean Li <[email protected]>

* try global tenant in before hook

Signed-off-by: Sean Li <[email protected]>

---------

Signed-off-by: Sean Li <[email protected]>
(cherry picked from commit 4faa0c9)

Co-authored-by: Sean Li <[email protected]>
Hailong-am pushed a commit that referenced this pull request Mar 29, 2024
* fixing gantt chart flaky tests

Signed-off-by: Sean Li <[email protected]>

* removing comments

Signed-off-by: Sean Li <[email protected]>

* try global tenant

Signed-off-by: Sean Li <[email protected]>

* try global tenant in before hook

Signed-off-by: Sean Li <[email protected]>

---------

Signed-off-by: Sean Li <[email protected]>
(cherry picked from commit 4faa0c9)

Co-authored-by: Sean Li <[email protected]>
LDrago27 pushed a commit to LDrago27/opensearch-dashboards-functional-test that referenced this pull request May 3, 2024
* fixing gantt chart flaky tests

Signed-off-by: Sean Li <[email protected]>

* removing comments

Signed-off-by: Sean Li <[email protected]>

* try global tenant

Signed-off-by: Sean Li <[email protected]>

* try global tenant in before hook

Signed-off-by: Sean Li <[email protected]>

---------

Signed-off-by: Sean Li <[email protected]>
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