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

[test_serverless/api_integration] convert alerting_wait_for_helpers into FTR service #162623

Conversation

dmlemeshko
Copy link
Member

Summary

This PR converts helpers into FTR services that should provide better test capabilities and improve stability/error output.

Before change:

 └-> should be active
         └-> "before each" hook: global before each for "should be active"
         └- ✖ fail: serverless observability API Threshold rule - AVG - PCT - FIRED Rule creation should be active
         │      Error: Timeout of 360000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/dmle/github/kibana/x-pack/test_serverless/api_integration/test_suites/observability/threshold_rule/avg_pct_fired.ts)
         │       at listOnTimeout (node:internal/timers:559:17)
         │       at processTimers (node:internal/timers:502:7)

The test is not handling its state properly and fails on mocha timeout (6 minutes) without proper error message. It leads the test suite usually taking ~5 min keep running for over 1 hour

After change:

2)    serverless observability API
 │       Threshold rule - AVG - PCT - FIRED
 │         Rule creation
 │           should be active:
 │
 │      Error: 'ruleId' is undefined
 │       at Object.waitForRuleStatus (alerting_api.ts:31:15)
 │       at Context.apply (avg_pct_fired.ts:122:51)
 │       at Object.apply (wrap_function.js:73:30)

Since the follow-up tests depend on the first test to success, we can either move Rule creation to before hook or check for ruleId to be defined. If it is defined, retry service will pull for status up to 90 sec (important to keep below Mocha timeout so you can get error) and fail if it is not matching expected one.

@dmlemeshko dmlemeshko requested a review from fkanout July 27, 2023 11:51
@dmlemeshko dmlemeshko added FTR v8.10.0 release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting labels Jul 27, 2023
@dmlemeshko dmlemeshko marked this pull request as ready for review July 27, 2023 17:48
Copy link
Contributor

@fkanout fkanout left a comment

Choose a reason for hiding this comment

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

AO changes LGTM. Thank you @dmlemeshko!

@dmlemeshko dmlemeshko enabled auto-merge (squash) August 1, 2023 15:55
@dmlemeshko dmlemeshko merged commit c4692b3 into elastic:main Aug 2, 2023
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@dmlemeshko dmlemeshko deleted the ftr-serverless/convert-alerting_wait_for_helpers-into-service branch November 21, 2023 12:25
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 FTR release_note:skip Skip the PR/issue when compiling release notes v8.10.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants