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

Add error handling/retry logic for search source alert tests #196443

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

lukasolson
Copy link
Member

@lukasolson lukasolson commented Oct 15, 2024

Summary

Resolves #193842.

Adds error handling & retry logic for search source alerts that are causing failures on MKI.

Checklist

@lukasolson lukasolson added release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting Team:DataDiscovery Discover App Team (Document Explorer, Saved Search, Surrounding documents, Data, DataViews) labels Oct 15, 2024
@lukasolson lukasolson self-assigned this Oct 15, 2024
@elasticmachine
Copy link
Contributor

elasticmachine commented Oct 15, 2024

🤖 Jobs for this PR can be triggered through checkboxes. 🚧

ℹ️ To trigger the CI, please tick the checkbox below 👇

  • Click to trigger kibana-pull-request for this PR!
  • Click to trigger kibana-deploy-project-from-pr for this PR!

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

cc @lukasolson

@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#7157

[✅] x-pack/test/functional_with_es_ssl/apps/discover_ml_uptime/config.ts: 25/25 tests passed.
[✅] x-pack/test_serverless/functional/test_suites/observability/common_configs/config.group6.ts: 25/25 tests passed.
[✅] x-pack/test_serverless/functional/test_suites/search/common_configs/config.group6.ts: 25/25 tests passed.
[✅] x-pack/test_serverless/functional/test_suites/security/common_configs/config.group6.ts: 25/25 tests passed.

see run history

@lukasolson
Copy link
Member Author

@wayneseymour Do you mind taking a quick look at this and see if it's along the lines of what you were thinking?

@wayneseymour wayneseymour self-requested a review October 22, 2024 10:54
Copy link
Member

@wayneseymour wayneseymour left a comment

Choose a reason for hiding this comment

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

@lukasolson I would strongly recommend running the serverless tests through MKI, from your local

One major reason is to ensure the default timeout durations encoded in x-pack/test_serverless/functional/test_suites/common/discover_ml_uptime/discover/search_source_alert.ts, actually work for real serverless as well.
PR CI only runs fake-serverless.
Running against real serverless (mki) will give you useful feedback.

  • network access is typically slower, etc

Ran From my Local

Ran the stateful test, no issues.
Ran the serverless test against a real serverless oblt project (mki), I am seeing errors:

└-: Discover alerting
  └-> "before all" hook: beforeTestSuite.trigger in "Discover alerting"
  └-> "before all" hook in "Discover alerting"
  └-: Search source Alert
    └-> "before all" hook: beforeTestSuite.trigger for "should create an alert when there is no data view"
    └-> "before all" hook for "should create an alert when there is no data view"
            │ERROR timeout of 60000ms exceeded
            │      Waiting 15000 ms before the next attempt
    └-> should create an alert when there is no data view
      └-> "before each" hook: global before each for "should create an alert when there is no data view"
      └- ✓ pass  (23.1s)
    └-> should show time field validation error
      └-> "before each" hook: global before each for "should show time field validation error"
      └- ✓ pass  (14.8s)
    └-> should navigate to alert results via view in app link
      └-> "before each" hook: global before each for "should navigate to alert results via view in app link"
      └- ✓ pass  (40.0s)
    └-> should navigate to alert results via link provided in notification
      └-> "before each" hook: global before each for "should navigate to alert results via link provided in notification"
      └- ✓ pass  (37.8s)
    └-> should display prev rule state after params update on clicking prev generated link
      └-> "before each" hook: global before each for "should display prev rule state after params update on clicking prev generated link"
      └- ✖ fail: Discover alerting Search source Alert should display prev rule state after params update on clicking prev generated link
      │      Error: retry.try reached timeout 120000 ms
      │ TimeoutError: Waiting for element to be located By(css selector, [data-test-subj="saveEditedRuleButton"])
      │ Wait timed out after 10054ms
      │     at /Users/trezworkbox/dev/main/node_modules/selenium-webdriver/lib/webdriver.js:923:22
      │     at processTicksAndRejections (node:internal/process/task_queues:95:5)
      │       at onFailure (retry_for_success.ts:18:9)
      │       at retryForSuccess (retry_for_success.ts:85:7)
      │       at Proxy.try (retry.ts:52:12)
      │       at Proxy.clickByCssSelector (find.ts:420:5)
      │       at Proxy.click (test_subjects.ts:169:5)
      │       at Context.<anonymous> (search_source_alert.ts:509:7)
      │       at Object.apply (wrap_function.js:74:16)
      │
      │
    └-> should display actual state after rule params update on clicking viewInApp link
      └-> "before each" hook: global before each for "should display actual state after rule params update on clicking viewInApp link"
      └- ✖ fail: Discover alerting Search source Alert should display actual state after rule params update on clicking viewInApp link
      │      Error: expected '' to equal 'message:msg-1'
      │       at Assertion.assert (expect.js:100:11)
      │       at Assertion.apply (expect.js:227:8)
      │       at Function.equal (expect.js:531:15)
      │       at checkUpdatedRuleParamsState (search_source_alert.ts:343:31)
      │       at processTicksAndRejections (node:internal/process/task_queues:95:5)
      │       at Context.<anonymous> (search_source_alert.ts:522:7)
      │       at Object.apply (wrap_function.js:74:16)
      │
      │
    └-> should display prev data view state after update on clicking prev generated link
      └-> "before each" hook: global before each for "should display prev data view state after update on clicking prev generated link"
     
     ....
     

I recommend running it against search and security projects as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:DataDiscovery Discover App Team (Document Explorer, Saved Search, Surrounding documents, Data, DataViews)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FTR][Serverless] Err handling needed in search_source_alert.ts
4 participants