-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Fix integration tests: Check for root before shutdown, bail after 1 reported issue #155938
Conversation
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
Pinging @elastic/kibana-core (Team:Core) |
There was a problem hiding this 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) { |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
…eported issue (elastic#155938) Co-authored-by: Kibana Machine <[email protected]> (cherry picked from commit ab8b7c1)
💔 Some backports could not be created
Note: Successful backport PRs will be merged automatically after passing CI. Manual backportTo create the backport manually run:
Questions ?Please refer to the Backport tool documentation |
…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]>
Friendly reminder: Looks like this PR hasn’t been backported yet. |
6 similar comments
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
5 similar comments
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Fix:
Implements:
--bail
in jest integration config, to only report 1 issueroot
is defined before calling shutdown, to stop multiplying errors