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

[ftr] handle unexpected Kibana/ES shutdowns better #131767

Merged

Conversation

spalger
Copy link
Contributor

@spalger spalger commented May 6, 2022

Fixes #131522

Adds the ability for the FTR to be notified when ProcRunner or ES Cluster instances exit unexpectedly in the background via a new onEarlyExit() callback passed to these two classes. They both work similarly in that they return promises for a start() function, and then after the tests return a promise for stop(), but in between when the process they monitor exits they both behave differently. ES Cluster's log about the exit, and ProcRunner instances reject a promise which can't be listened to, causing the process to exit. This leads to the problem described in #131522 because when the process it exitted the test runner doesn't get a chance to write the report and devs can't inspect the reasoning for the failure. This changes the behavior to instead inject an error into mocha via runner.uncaught(error) which treats the passed error as an error caused by the current runnable under tests, then runner.abort() is called to stop the tests. This isn't a very clean way to exit, but it still provides the reporting we need to understand what happened.

Confirmed with https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/570#_ that Kibana failures which kill the process properly kill the job and trigger a useful report of the test that was running when the failure occurred: https://buildkite.com/organizations/elastic/pipelines/kibana-flaky-test-suite-runner/builds/570/jobs/9e3dbed4-bab9-4513-a9d1-ab372415fdae/artifacts/b5a9f677-8ac8-4f04-9bcd-c989769d4488

@spalger spalger added Team:Operations Team label for Operations Team release_note:skip Skip the PR/issue when compiling release notes v8.3.0 v8.2.1 v7.17.4 auto-backport Deprecated - use backport:version if exact versions are needed labels May 6, 2022
@spalger spalger marked this pull request as ready for review May 6, 2022 21:53
@spalger spalger requested a review from a team as a code owner May 6, 2022 21:53
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-operations (Team:Operations)

@spalger spalger enabled auto-merge (squash) May 9, 2022 14:25
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/test 198 200 +2
Unknown metric groups

API count

id before after diff
@kbn/test 236 239 +3

History

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

@spalger spalger merged commit c6108ba into elastic:main May 9, 2022
@spalger spalger deleted the fix/ftr-better-kibana-early-exit-handling branch May 9, 2022 15:08
@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.2 Backport failed because of merge conflicts
7.17 Backport failed because of merge conflicts

You might need to backport the following PRs to 7.17:
- Add Playwright Service and New User Journeys for Performance tests (#124259)
- [kbn/es] add support for --ready-timeout (#126217)

Manual backport

To create the backport manually run:

node scripts/backport --pr 131767

Questions ?

Please refer to the Backport tool documentation

spalger pushed a commit to spalger/kibana that referenced this pull request May 9, 2022
(cherry picked from commit c6108ba)

# Conflicts:
#	packages/kbn-test/src/functional_test_runner/functional_test_runner.ts
spalger pushed a commit to spalger/kibana that referenced this pull request May 9, 2022
(cherry picked from commit c6108ba)

# Conflicts:
#	packages/kbn-es/src/cluster.js
#	packages/kbn-test/src/es/test_es_cluster.ts
#	packages/kbn-test/src/functional_test_runner/functional_test_runner.ts
#	packages/kbn-test/src/functional_tests/lib/run_elasticsearch.ts
#	packages/kbn-test/src/functional_tests/tasks.ts
#	packages/kbn-typed-react-router-config/src/route.ts
spalger pushed a commit that referenced this pull request May 9, 2022
…131812)

* [ftr] handle unexpected Kibana/ES shutdowns better (#131767)

(cherry picked from commit c6108ba)

# Conflicts:
#	packages/kbn-test/src/functional_test_runner/functional_test_runner.ts

* fix rxjs usage
kertal pushed a commit to kertal/kibana that referenced this pull request May 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed release_note:skip Skip the PR/issue when compiling release notes Team:Operations Team label for Operations Team v7.17.4 v8.2.1 v8.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CI Failures: Kibana process dies during esArchiver's migrateKibanaIndex
5 participants