Skip to content

[Discover][Metrics] Fix e2e metrics flaky test#254786

Merged
lucaslopezf merged 19 commits intoelastic:mainfrom
lucaslopezf:254752-fix-e2e-metrics-flaky-test
Mar 3, 2026
Merged

[Discover][Metrics] Fix e2e metrics flaky test#254786
lucaslopezf merged 19 commits intoelastic:mainfrom
lucaslopezf:254752-fix-e2e-metrics-flaky-test

Conversation

@lucaslopezf
Copy link
Copy Markdown
Contributor

@lucaslopezf lucaslopezf commented Feb 24, 2026

Closes: #254759, #254760, #254752

Summary

Fixes flaky Metrics Experience E2E tests by reorganizing the Scout test structure to comply with Scout's config naming requirements.

Root Cause

Scout expects specific config names (parallel.playwright.config.ts or playwright.config.ts) to properly assign CI cluster resources. Our custom names (metrics_experience.parallel.playwright.config.ts, traces_experience.parallel.playwright.config.ts) caused Scout to fall back to a default cluster with fewer resources, leading to intermittent timeouts.

Changes

  • Unified config: Single parallel.playwright.config.ts pointing to ./parallel_tests
  • Unified global setup: Single globalSetupHook handling both Metrics and Traces data setup

This PR is necessary to avoid CI cluster misassignment and test flakiness. More details in this comment.

Thanks a lot @dmlemeshko !!

Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

  • Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support
  • Documentation was added for features that require explanation or tutorials
  • Unit or functional tests were updated or added to match the most common scenarios
  • If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the docker list
  • This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The release_note:breaking label should be applied in these situations.
  • Flaky Test Runner was used on any tests changed
  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines
  • Review the backport guidelines and apply applicable backport:* labels.

Identify risks

Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging.

@lucaslopezf
Copy link
Copy Markdown
Contributor Author

/ci

@lucaslopezf
Copy link
Copy Markdown
Contributor Author

/flaky scoutConfig:src/platform/plugins/shared/discover/test/scout/ui/metrics_experience_parallel.playwright.config.ts:30

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner

✅ Build triggered - kibana-flaky-test-suite-runner#10843

  • src/platform/plugins/shared/discover/test/scout/ui/metrics_experience_parallel.playwright.config.ts x30

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner Stats

🟠 Some tests failed. - kibana-flaky-test-suite-runner#10843

[❌] src/platform/plugins/shared/discover/test/scout/ui/metrics_experience_parallel.playwright.config.ts: 0/30 tests passed.

see run history

@lucaslopezf
Copy link
Copy Markdown
Contributor Author

/ci

@lucaslopezf
Copy link
Copy Markdown
Contributor Author

/flaky scoutConfig:src/platform/plugins/shared/discover/test/scout/ui/metrics_experience_parallel.playwright.config.ts:30

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner

✅ Build triggered - kibana-flaky-test-suite-runner#10845

  • src/platform/plugins/shared/discover/test/scout/ui/metrics_experience_parallel.playwright.config.ts x30

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#10845

[✅] src/platform/plugins/shared/discover/test/scout/ui/metrics_experience_parallel.playwright.config.ts: 30/30 tests passed.

see run history

@lucaslopezf
Copy link
Copy Markdown
Contributor Author

/ci

@lucaslopezf
Copy link
Copy Markdown
Contributor Author

/flaky scoutConfig:src/platform/plugins/shared/discover/test/scout/ui/metrics_experience_parallel.playwright.config.ts:30

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner

✅ Build triggered - kibana-flaky-test-suite-runner#10846

  • src/platform/plugins/shared/discover/test/scout/ui/metrics_experience_parallel.playwright.config.ts x30

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#10846

[✅] src/platform/plugins/shared/discover/test/scout/ui/metrics_experience_parallel.playwright.config.ts: 30/30 tests passed.

see run history

@lucaslopezf
Copy link
Copy Markdown
Contributor Author

/flaky scoutConfig:src/platform/plugins/shared/discover/test/scout/ui/metrics_experience_parallel.playwright.config.ts:30

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner

✅ Build triggered - kibana-flaky-test-suite-runner#10847

  • src/platform/plugins/shared/discover/test/scout/ui/metrics_experience_parallel.playwright.config.ts x30

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#10847

[✅] src/platform/plugins/shared/discover/test/scout/ui/metrics_experience_parallel.playwright.config.ts: 30/30 tests passed.

see run history

@lucaslopezf
Copy link
Copy Markdown
Contributor Author

/ci

@lucaslopezf
Copy link
Copy Markdown
Contributor Author

/ci

@lucaslopezf
Copy link
Copy Markdown
Contributor Author

/flaky scoutConfig:src/platform/plugins/shared/discover/test/scout/ui/metrics_experience_parallel.playwright.config.ts:35

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner

✅ Build triggered - kibana-flaky-test-suite-runner#10858

  • src/platform/plugins/shared/discover/test/scout/ui/metrics_experience_parallel.playwright.config.ts x35

@lucaslopezf lucaslopezf changed the title Wait for discoverLayout before checking data view switch [Discover][Metrics] Fix e2e metrics flaky test Feb 25, 2026
@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#10858

[✅] src/platform/plugins/shared/discover/test/scout/ui/metrics_experience_parallel.playwright.config.ts: 35/35 tests passed.

see run history

@lucaslopezf
Copy link
Copy Markdown
Contributor Author

/flaky scoutConfig:src/platform/plugins/shared/discover/test/scout/ui/metrics_experience_parallel.playwright.config.ts:40

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner

✅ Build triggered - kibana-flaky-test-suite-runner#10859

  • src/platform/plugins/shared/discover/test/scout/ui/metrics_experience_parallel.playwright.config.ts x40

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#10917

[✅] src/platform/plugins/shared/discover/test/scout/ui/parallel.playwright.config.ts: 50/50 tests passed.

see run history

@lucaslopezf
Copy link
Copy Markdown
Contributor Author

/flaky scoutConfig:src/platform/plugins/shared/discover/test/scout/ui/parallel.playwright.config.ts:50

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner

✅ Build triggered - kibana-flaky-test-suite-runner#10921

  • src/platform/plugins/shared/discover/test/scout/ui/parallel.playwright.config.ts x50

@lucaslopezf lucaslopezf added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting Team:obs-exploration Observability Exploration team v9.4.0 labels Mar 2, 2026
@lucaslopezf
Copy link
Copy Markdown
Contributor Author

/ci

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#10921

[✅] src/platform/plugins/shared/discover/test/scout/ui/parallel.playwright.config.ts: 50/50 tests passed.

see run history

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

@lucaslopezf lucaslopezf marked this pull request as ready for review March 2, 2026 12:16
@lucaslopezf lucaslopezf requested review from a team as code owners March 2, 2026 12:16
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/obs-exploration-team (Team:obs-exploration)

Copy link
Copy Markdown
Contributor

@iblancof iblancof left a comment

Choose a reason for hiding this comment

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

Worth mentioning for other reviewers that this is just a temporary workaround until the appex team adds support for separating tests with namespaces (which will be happening soon in appex-qa-team/762) .

There’s already an issue (observability-dev/5290) created on our side to separate the configs/ownerships again once that support is merged.

Copy link
Copy Markdown
Contributor

@akowalska622 akowalska622 left a comment

Choose a reason for hiding this comment

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

Data Discovery changes LGTM

@lucaslopezf
Copy link
Copy Markdown
Contributor Author

/flaky scoutConfig:src/platform/plugins/shared/discover/test/scout/ui/parallel.playwright.config.ts:100

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner

✅ Build triggered - kibana-flaky-test-suite-runner#10927

  • src/platform/plugins/shared/discover/test/scout/ui/parallel.playwright.config.ts x100

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#10927

[✅] src/platform/plugins/shared/discover/test/scout/ui/parallel.playwright.config.ts: 100/100 tests passed.

see run history

@lucaslopezf lucaslopezf merged commit ab46925 into elastic:main Mar 3, 2026
16 checks passed
DennisKo pushed a commit to DennisKo/kibana that referenced this pull request Mar 6, 2026
Closes: elastic#254759, elastic#254760, elastic#254752

## Summary

Fixes flaky Metrics Experience E2E tests by reorganizing the Scout test
structure to comply with Scout's config naming requirements.

### Root Cause

Scout expects specific config names (`parallel.playwright.config.ts` or
`playwright.config.ts`) to properly assign CI cluster resources. Our
custom names (`metrics_experience.parallel.playwright.config.ts`,
`traces_experience.parallel.playwright.config.ts`) caused Scout to fall
back to a default cluster with fewer resources, leading to intermittent
timeouts.

### Changes

- **Unified config**: Single `parallel.playwright.config.ts` pointing to
`./parallel_tests`
- **Unified global setup**: Single `globalSetupHook` handling both
Metrics and Traces data setup

This PR is necessary to avoid CI cluster misassignment and test
flakiness. More details in [this
comment](elastic#254759 (comment)).

Thanks a lot @dmlemeshko !!

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [ ] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
qn895 pushed a commit to qn895/kibana that referenced this pull request Mar 11, 2026
Closes: elastic#254759, elastic#254760, elastic#254752

## Summary

Fixes flaky Metrics Experience E2E tests by reorganizing the Scout test
structure to comply with Scout's config naming requirements.

### Root Cause

Scout expects specific config names (`parallel.playwright.config.ts` or
`playwright.config.ts`) to properly assign CI cluster resources. Our
custom names (`metrics_experience.parallel.playwright.config.ts`,
`traces_experience.parallel.playwright.config.ts`) caused Scout to fall
back to a default cluster with fewer resources, leading to intermittent
timeouts.

### Changes

- **Unified config**: Single `parallel.playwright.config.ts` pointing to
`./parallel_tests`
- **Unified global setup**: Single `globalSetupHook` handling both
Metrics and Traces data setup

This PR is necessary to avoid CI cluster misassignment and test
flakiness. More details in [this
comment](elastic#254759 (comment)).

Thanks a lot @dmlemeshko !!

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [ ] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting Feature:Metrics in Discover release_note:skip Skip the PR/issue when compiling release notes Team:obs-exploration Observability Exploration team v9.4.0

Projects

None yet

6 participants