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

[Dataset Quality] Fix failing test on mki qa #196122

Merged

Conversation

achyutjhunjhunwala
Copy link
Contributor

@achyutjhunjhunwala achyutjhunjhunwala commented Oct 14, 2024

Summary

Closes #195466

As LogDB mode is enabled on MKI QA environment, it causes mappings for certain fields like host.name to be set differently. Hence causing tests to fail.

As part of the fix, before ingesting data, i am statically setting the mappings so that it does not cause any collision with something outside the scope of the tests

Copy link
Member

@dmlemeshko dmlemeshko left a comment

Choose a reason for hiding this comment

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

Code change lgtm, left few questions. Please give it a run against MKI before merging.

Comment on lines +56 to +66
try {
await this.client.cluster.putComponentTemplate({
name,
template: {
mappings,
},
});
this.logger.info(`Component template successfully created: ${name}`);
} catch (err) {
this.logger.error(`Component template creation failed: ${name} - ${err.message}`);
}
Copy link
Member

Choose a reason for hiding this comment

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

Does it make sense to continue with test run when component template does not exist/failed to create?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well The only use case, where they will fail to create, would be either a Network issue or User roles and right issue. In that case, the test would fail.

Copy link
Member

@dmlemeshko dmlemeshko Oct 14, 2024

Choose a reason for hiding this comment

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

If it is required by test to exist, I suggest throwing an error instead of just logging it. Thoughts?

@elasticmachine
Copy link
Contributor

⏳ Build in-progress

  • Buildkite Build
  • Commit: 42b8347
  • Kibana Serverless Image: docker.elastic.co/kibana-ci/kibana-serverless:pr-196122-42b834759b32

History

cc @achyutjhunjhunwala

Copy link
Contributor

@mohamedhamed-ahmed mohamedhamed-ahmed left a comment

Choose a reason for hiding this comment

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

LGTM!

@achyutjhunjhunwala
Copy link
Contributor Author

@dmlemeshko

I ran my PR locally against MKI

Deployment Agnostic Tests

  • My tests pass, but 2 of Obs Alerting tests are constantly failing. Not sure why, but not related to my change
image

FTR Tests

image

@achyutjhunjhunwala achyutjhunjhunwala merged commit 7237902 into elastic:main Oct 14, 2024
24 checks passed
@achyutjhunjhunwala achyutjhunjhunwala deleted the fix-failing-test-on-mki-qa branch October 14, 2024 19:19
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/11333712852

@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.x Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 196122

Questions ?

Please refer to the Backport tool documentation

@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Oct 16, 2024
@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 196122 locally

@gbamparop
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 196122 locally

@achyutjhunjhunwala were you planning to backport this?

@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 196122 locally

@achyutjhunjhunwala
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
8.16

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

Questions ?

Please refer to the Backport tool documentation

achyutjhunjhunwala added a commit to achyutjhunjhunwala/kibana that referenced this pull request Oct 18, 2024
## Summary

Closes elastic#195466

As LogDB mode is enabled on MKI QA environment, it causes mappings for
certain fields like `host.name` to be set differently. Hence causing
tests to fail.

As part of the fix, before ingesting data, i am statically setting the
mappings so that it does not cause any collision with something outside
the scope of the tests

(cherry picked from commit 7237902)

# Conflicts:
#	x-pack/test/api_integration/deployment_agnostic/apis/observability/dataset_quality/degraded_field_analyze.ts
#	x-pack/test_serverless/functional/test_suites/observability/dataset_quality/degraded_field_flyout.ts
achyutjhunjhunwala added a commit that referenced this pull request Oct 18, 2024
# Backport

This will backport the following commits from `main` to `8.16`:
- [[Dataset Quality] Fix failing test on mki qa
(#196122)](#196122)

<!--- Backport version: 8.9.8 -->

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

<!--BACKPORT [{"author":{"name":"Achyut
Jhunjhunwala","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-14T19:19:10Z","message":"[Dataset
Quality] Fix failing test on mki qa (#196122)\n\n##
Summary\r\n\r\nCloses
https://github.com/elastic/kibana/issues/195466\r\n\r\nAs LogDB mode is
enabled on MKI QA environment, it causes mappings for\r\ncertain fields
like `host.name` to be set differently. Hence causing\r\ntests to
fail.\r\n\r\nAs part of the fix, before ingesting data, i am statically
setting the\r\nmappings so that it does not cause any collision with
something outside\r\nthe scope of the
tests","sha":"7237902fad6424d9556cff78e3f3ac7e62fa4bac","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport
missing","v9.0.0","backport:prev-minor","ci:project-deploy-observability","Team:obs-ux-logs","Team:obs-ux-infra_services","Feature:Dataset
Health","apm:review"],"number":196122,"url":"https://github.com/elastic/kibana/pull/196122","mergeCommit":{"message":"[Dataset
Quality] Fix failing test on mki qa (#196122)\n\n##
Summary\r\n\r\nCloses
https://github.com/elastic/kibana/issues/195466\r\n\r\nAs LogDB mode is
enabled on MKI QA environment, it causes mappings for\r\ncertain fields
like `host.name` to be set differently. Hence causing\r\ntests to
fail.\r\n\r\nAs part of the fix, before ingesting data, i am statically
setting the\r\nmappings so that it does not cause any collision with
something outside\r\nthe scope of the
tests","sha":"7237902fad6424d9556cff78e3f3ac7e62fa4bac"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/196122","number":196122,"mergeCommit":{"message":"[Dataset
Quality] Fix failing test on mki qa (#196122)\n\n##
Summary\r\n\r\nCloses
https://github.com/elastic/kibana/issues/195466\r\n\r\nAs LogDB mode is
enabled on MKI QA environment, it causes mappings for\r\ncertain fields
like `host.name` to be set differently. Hence causing\r\ntests to
fail.\r\n\r\nAs part of the fix, before ingesting data, i am statically
setting the\r\nmappings so that it does not cause any collision with
something outside\r\nthe scope of the
tests","sha":"7237902fad6424d9556cff78e3f3ac7e62fa4bac"}}]}] BACKPORT-->
@kibanamachine kibanamachine added v8.16.0 and removed backport missing Added to PRs automatically when the are determined to be missing a backport. labels Oct 18, 2024
@jbudz
Copy link
Member

jbudz commented Oct 18, 2024

@achyutjhunjhunwala there's a version gap with this backport. Can you check if this should also be backported to 8.x/8.17?

@achyutjhunjhunwala
Copy link
Contributor Author

achyutjhunjhunwala commented Oct 18, 2024

@jbudz i am a bit confused here. So this PR was merged to main before the 8.16 release.
The automatic backport for the label backport:prevMinor failed due to some conflicts which i manually resolved by manually creating a backport to 8.16 and merged it.

Now what do you mean by 8.x/8.17
Do we already have a branch for 8.17 ? I thought everything which gets merged to main with that backport label is now 8.17 ?

@jbudz
Copy link
Member

jbudz commented Oct 18, 2024

Active branches: we have main, 8.x, 8.16, 8.15, and 7.17. I noticed a backport message for 8.16 but not 8.x, if I misread please disregard. main is currently pointing to 9.0.0. 8.x is currently pointing to 8.17.0.

@achyutjhunjhunwala
Copy link
Contributor Author

@jbudz Now i understand this better. Thank you for the detailed explanation.
Surely i missed the backport to 8.x

I will create the backport now.

@achyutjhunjhunwala
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
8.x

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

Questions ?

Please refer to the Backport tool documentation

achyutjhunjhunwala added a commit to achyutjhunjhunwala/kibana that referenced this pull request Oct 21, 2024
## Summary

Closes elastic#195466

As LogDB mode is enabled on MKI QA environment, it causes mappings for
certain fields like `host.name` to be set differently. Hence causing
tests to fail.

As part of the fix, before ingesting data, i am statically setting the
mappings so that it does not cause any collision with something outside
the scope of the tests

(cherry picked from commit 7237902)

# Conflicts:
#	x-pack/test/api_integration/deployment_agnostic/apis/observability/dataset_quality/degraded_field_analyze.ts
#	x-pack/test_serverless/functional/test_suites/observability/dataset_quality/degraded_field_flyout.ts
achyutjhunjhunwala added a commit that referenced this pull request Oct 23, 2024
# Backport

This will backport the following commits from `main` to `8.x`:
- [[Dataset Quality] Fix failing test on mki qa
(#196122)](#196122)

<!--- Backport version: 8.9.8 -->

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

<!--BACKPORT [{"author":{"name":"Achyut
Jhunjhunwala","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-14T19:19:10Z","message":"[Dataset
Quality] Fix failing test on mki qa (#196122)\n\n##
Summary\r\n\r\nCloses
https://github.com/elastic/kibana/issues/195466\r\n\r\nAs LogDB mode is
enabled on MKI QA environment, it causes mappings for\r\ncertain fields
like `host.name` to be set differently. Hence causing\r\ntests to
fail.\r\n\r\nAs part of the fix, before ingesting data, i am statically
setting the\r\nmappings so that it does not cause any collision with
something outside\r\nthe scope of the
tests","sha":"7237902fad6424d9556cff78e3f3ac7e62fa4bac","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor","ci:project-deploy-observability","Team:obs-ux-logs","Team:obs-ux-infra_services","Feature:Dataset
Health","apm:review","v8.16.0"],"number":196122,"url":"https://github.com/elastic/kibana/pull/196122","mergeCommit":{"message":"[Dataset
Quality] Fix failing test on mki qa (#196122)\n\n##
Summary\r\n\r\nCloses
https://github.com/elastic/kibana/issues/195466\r\n\r\nAs LogDB mode is
enabled on MKI QA environment, it causes mappings for\r\ncertain fields
like `host.name` to be set differently. Hence causing\r\ntests to
fail.\r\n\r\nAs part of the fix, before ingesting data, i am statically
setting the\r\nmappings so that it does not cause any collision with
something outside\r\nthe scope of the
tests","sha":"7237902fad6424d9556cff78e3f3ac7e62fa4bac"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/196122","number":196122,"mergeCommit":{"message":"[Dataset
Quality] Fix failing test on mki qa (#196122)\n\n##
Summary\r\n\r\nCloses
https://github.com/elastic/kibana/issues/195466\r\n\r\nAs LogDB mode is
enabled on MKI QA environment, it causes mappings for\r\ncertain fields
like `host.name` to be set differently. Hence causing\r\ntests to
fail.\r\n\r\nAs part of the fix, before ingesting data, i am statically
setting the\r\nmappings so that it does not cause any collision with
something outside\r\nthe scope of the
tests","sha":"7237902fad6424d9556cff78e3f3ac7e62fa4bac"}},{"branch":"8.x","label":"v8.16.0","labelRegex":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"url":"https://github.com/elastic/kibana/pull/196816","number":196816,"branch":"8.16","state":"MERGED","mergeCommit":{"sha":"d7bbd0adf3108fc00dddf361bc4d7840ded5dc8f","message":"[8.16]
[Dataset Quality] Fix failing test on mki qa (#196122) (#196816)\n\n#
Backport\n\nThis will backport the following commits from `main` to
`8.16`:\n- [[Dataset Quality] Fix failing test on mki
qa\n(#196122)](https://github.com/elastic/kibana/pull/196122)\n\n<!---
Backport version: 8.9.8 -->\n\n### Questions ?\nPlease refer to the
[Backport
tool\ndocumentation](https://github.com/sqren/backport)\n\n<!--BACKPORT
[{\"author\":{\"name\":\"Achyut\nJhunjhunwala\",\"email\":\"[email protected]\"},\"sourceCommit\":{\"committedDate\":\"2024-10-14T19:19:10Z\",\"message\":\"[Dataset\nQuality]
Fix failing test on mki qa
(#196122)\\n\\n##\nSummary\\r\\n\\r\\nCloses\nhttps://github.com//issues/195466\\r\\n\\r\\nAs
LogDB mode is\nenabled on MKI QA environment, it causes mappings
for\\r\\ncertain fields\nlike `host.name` to be set differently. Hence
causing\\r\\ntests to\nfail.\\r\\n\\r\\nAs part of the fix, before
ingesting data, i am statically\nsetting the\\r\\nmappings so that it
does not cause any collision with\nsomething outside\\r\\nthe scope of
the\ntests\",\"sha\":\"7237902fad6424d9556cff78e3f3ac7e62fa4bac\",\"branchLabelMapping\":{\"^v9.0.0$\":\"main\",\"^v8.16.0$\":\"8.x\",\"^v(\\\\d+).(\\\\d+).\\\\d+$\":\"$1.$2\"}},\"sourcePullRequest\":{\"labels\":[\"release_note:skip\",\"backport\nmissing\",\"v9.0.0\",\"backport:prev-minor\",\"ci:project-deploy-observability\",\"Team:obs-ux-logs\",\"Team:obs-ux-infra_services\",\"Feature:Dataset\nHealth\",\"apm:review\"],\"number\":196122,\"url\":\"https://github.com/elastic/kibana/pull/196122\",\"mergeCommit\":{\"message\":\"[Dataset\nQuality]
Fix failing test on mki qa
(#196122)\\n\\n##\nSummary\\r\\n\\r\\nCloses\nhttps://github.com//issues/195466\\r\\n\\r\\nAs
LogDB mode is\nenabled on MKI QA environment, it causes mappings
for\\r\\ncertain fields\nlike `host.name` to be set differently. Hence
causing\\r\\ntests to\nfail.\\r\\n\\r\\nAs part of the fix, before
ingesting data, i am statically\nsetting the\\r\\nmappings so that it
does not cause any collision with\nsomething outside\\r\\nthe scope of
the\ntests\",\"sha\":\"7237902fad6424d9556cff78e3f3ac7e62fa4bac\"}},\"sourceBranch\":\"main\",\"suggestedTargetBranches\":[],\"targetPullRequestStates\":[{\"branch\":\"main\",\"label\":\"v9.0.0\",\"labelRegex\":\"^v9.0.0$\",\"isSourceBranch\":true,\"state\":\"MERGED\",\"url\":\"https://github.com/elastic/kibana/pull/196122\",\"number\":196122,\"mergeCommit\":{\"message\":\"[Dataset\nQuality]
Fix failing test on mki qa
(#196122)\\n\\n##\nSummary\\r\\n\\r\\nCloses\nhttps://github.com//issues/195466\\r\\n\\r\\nAs
LogDB mode is\nenabled on MKI QA environment, it causes mappings
for\\r\\ncertain fields\nlike `host.name` to be set differently. Hence
causing\\r\\ntests to\nfail.\\r\\n\\r\\nAs part of the fix, before
ingesting data, i am statically\nsetting the\\r\\nmappings so that it
does not cause any collision with\nsomething outside\\r\\nthe scope of
the\ntests\",\"sha\":\"7237902fad6424d9556cff78e3f3ac7e62fa4bac\"}}]}]
BACKPORT-->"}}]}] BACKPORT-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apm:review backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) ci:project-deploy-observability Create an Observability project Feature:Dataset Health release_note:skip Skip the PR/issue when compiling release notes Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team Team:obs-ux-logs Observability Logs User Experience Team v8.16.0 v9.0.0
Projects
None yet
9 participants