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 integration tests: Check for root before shutdown, bail after 1 reported issue #155938

Merged

Conversation

TinaHeiligers
Copy link
Contributor

@TinaHeiligers TinaHeiligers commented Apr 26, 2023

Fix:

Implements:

  • --bail in jest integration config, to only report 1 issue
  • Updates tests to check if root is defined before calling shutdown, to stop multiplying errors

@TinaHeiligers TinaHeiligers added release_note:skip Skip the PR/issue when compiling release notes backport:all-open Backport to all branches that could still receive a release Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc labels Apr 26, 2023
@TinaHeiligers
Copy link
Contributor Author

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Unknown metric groups

ESLint disabled line counts

id before after diff
enterpriseSearch 17 19 +2
securitySolution 399 402 +3
total +5

Total ESLint disabled count

id before after diff
enterpriseSearch 18 20 +2
securitySolution 479 482 +3
total +5

History

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

@TinaHeiligers TinaHeiligers marked this pull request as ready for review April 26, 2023 23:00
@TinaHeiligers TinaHeiligers requested a review from a team as a code owner April 26, 2023 23:00
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-core (Team:Core)

@TinaHeiligers TinaHeiligers requested a review from a team April 27, 2023 01:06
Copy link
Member

@afharo afharo left a comment

Choose a reason for hiding this comment

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

LGTM!

Mind that we'll need to close all the issue manually because they are not linked as resolved by this PR (I think GH needs an explicit Fix: #ISSUE_NUMBER repeated on every line 😓

@@ -46,8 +46,10 @@ describe('SavedObjectsRepository', () => {
});

afterAll(async () => {
await esServer.stop();
await root.shutdown();
if (root) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if we shouldn't be stopping root first. IMO it would make more sense (as it is done in the other test modified by this PR).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can but do we need to?

await root.shutdown();
await hapiServer.stop({ timeout: 1000 });
await esServer.stop();
if (root) {
Copy link
Contributor

Choose a reason for hiding this comment

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

If we get to a point where we started esServer, but we did not initialize root (or hapiServer), we will not be explicitly stopping them here. Perhaps we could remove the if statement and do something like:

  await root?.shutdown();
  await hapiServer?.stop({ timeout: 1000 });
  await esServer?.stop();

WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see that used in other tests but prefer not to use shorthand here. It's very easy to delete a ?, but less easy to remove a whole if condition.

@TinaHeiligers TinaHeiligers merged commit ab8b7c1 into elastic:main Apr 27, 2023
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Apr 27, 2023
…eported issue (elastic#155938)

Co-authored-by: Kibana Machine <[email protected]>
(cherry picked from commit ab8b7c1)
@kibanamachine
Copy link
Contributor

💔 Some backports could not be created

Status Branch Result
7.17 Backport failed because of merge conflicts
8.8

Note: Successful backport PRs will be merged automatically after passing CI.

Manual backport

To create the backport manually run:

node scripts/backport --pr 155938

Questions ?

Please refer to the Backport tool documentation

This was referenced Apr 27, 2023
This was referenced Apr 27, 2023
kibanamachine added a commit that referenced this pull request Apr 27, 2023
…er 1 reported issue (#155938) (#156013)

# Backport

This will backport the following commits from `main` to `8.8`:
- [Fix integration tests: Check for root before shutdown, bail after 1
reported issue (#155938)](#155938)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Christiane (Tina)
Heiligers","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-04-27T13:54:54Z","message":"Fix
integration tests: Check for root before shutdown, bail after 1 reported
issue (#155938)\n\nCo-authored-by: Kibana Machine
<[email protected]>","sha":"ab8b7c10cd7f48e88264ad6fc0a656279e7dcdfe","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Core","release_note:skip","backport:all-open","v8.9.0"],"number":155938,"url":"https://github.com/elastic/kibana/pull/155938","mergeCommit":{"message":"Fix
integration tests: Check for root before shutdown, bail after 1 reported
issue (#155938)\n\nCo-authored-by: Kibana Machine
<[email protected]>","sha":"ab8b7c10cd7f48e88264ad6fc0a656279e7dcdfe"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/155938","number":155938,"mergeCommit":{"message":"Fix
integration tests: Check for root before shutdown, bail after 1 reported
issue (#155938)\n\nCo-authored-by: Kibana Machine
<[email protected]>","sha":"ab8b7c10cd7f48e88264ad6fc0a656279e7dcdfe"}}]}]
BACKPORT-->

Co-authored-by: Christiane (Tina) Heiligers <[email protected]>
@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Jan 16, 2024
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add the label auto-backport or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 155938 locally

6 similar comments
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add the label auto-backport or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 155938 locally

@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add the label auto-backport or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 155938 locally

@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add the label auto-backport or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 155938 locally

@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add the label auto-backport or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 155938 locally

@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add the label auto-backport or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 155938 locally

@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add the label auto-backport or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 155938 locally

@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 155938 locally

5 similar comments
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 155938 locally

@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 155938 locally

@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 155938 locally

@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 155938 locally

@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 155938 locally

@TinaHeiligers TinaHeiligers added backport:skip This commit does not require backporting and removed backport missing Added to PRs automatically when the are determined to be missing a backport. backport:all-open Backport to all branches that could still receive a release labels Oct 10, 2024
@TinaHeiligers TinaHeiligers deleted the saved-objects-fix-proxie-tests branch October 10, 2024 19:52
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:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v8.8.0 v8.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants