Skip to content

[Unified Data Table] Improve failing test speed#243168

Merged
AlexGPlay merged 2 commits into
elastic:mainfrom
AlexGPlay:234829-improve-test-speed
Nov 18, 2025
Merged

[Unified Data Table] Improve failing test speed#243168
AlexGPlay merged 2 commits into
elastic:mainfrom
AlexGPlay:234829-improve-test-speed

Conversation

@AlexGPlay
Copy link
Copy Markdown
Contributor

@AlexGPlay AlexGPlay commented Nov 17, 2025

Summary

Closes #234829
Closes #240905
Closes #240904

All 3 tests were timing out so lets try to improve how fast they run - for this this PR changes from get/queryByRole to get/queryByTestId as it speeds up the tests significantly.

Times measured isolating the tests using it.only and using the mean time of 10 runs + mean time of 10 runs of the whole file.

Note

Both scripts to measure the test times were generated by ChatGPT

Individual tests where measured with this script + it.only: run-tests.sh
The whole test file was measured using this script: all-tests.sh

Test Before After
should show the reset width button only for absolute width columns, and allow resetting to default width 1268ms 637ms
should not reset the last column to auto width when there are remaining auto width columns 894ms 346ms
should reset the last column to auto width if only absolute width columns remain 893ms 359ms
All tests 21.069s 17.338s

Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

@AlexGPlay AlexGPlay self-assigned this Nov 17, 2025
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
cloudSecurityPosture 641.3KB 641.3KB +48.0B
discover 1.2MB 1.2MB +48.0B
esql 574.8KB 574.9KB +48.0B
esqlDataGrid 148.8KB 148.9KB +48.0B
securitySolution 11.1MB 11.1MB +48.0B
slo 983.8KB 983.9KB +48.0B
total +288.0B

History

cc @AlexGPlay

@AlexGPlay AlexGPlay added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting Team:DataDiscovery Discover, search (data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. t// labels Nov 17, 2025
@AlexGPlay AlexGPlay marked this pull request as ready for review November 17, 2025 14:56
@AlexGPlay AlexGPlay requested review from a team as code owners November 17, 2025 14:56
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

Copy link
Copy Markdown
Contributor

@PhilippeOberti PhilippeOberti left a comment

Choose a reason for hiding this comment

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

Code review only, thanks for making tests run faster. LGTM for the @elastic/security-threat-hunting-investigations team

Copy link
Copy Markdown
Contributor

@davismcphee davismcphee left a comment

Choose a reason for hiding this comment

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

Awesome, thanks! Let's see how it goes 🤞

@AlexGPlay AlexGPlay merged commit 94c5602 into elastic:main Nov 18, 2025
20 checks passed
eokoneyo pushed a commit to eokoneyo/kibana that referenced this pull request Dec 2, 2025
## Summary

Closes elastic#234829
Closes elastic#240905
Closes elastic#240904

All 3 tests were timing out so lets try to improve how fast they run -
for this this PR changes from `get/queryByRole` to `get/queryByTestId`
as it speeds up the tests significantly.

Times measured isolating the tests using `it.only` and using the mean
time of 10 runs + mean time of 10 runs of the whole file.

> [!NOTE]
> Both scripts to measure the test times were generated by ChatGPT

Individual tests where measured with this script + `it.only`:
[run-tests.sh](https://github.com/user-attachments/files/23580522/run-tests.sh)
The whole test file was measured using this script:
[all-tests.sh](https://github.com/user-attachments/files/23580737/all-tests.sh)

| Test | Before | After |
|--|--------|------|
| should show the reset width button only for absolute width columns,
and allow resetting to default width | 1268ms | 637ms |
| should not reset the last column to auto width when there are
remaining auto width columns | 894ms | 346ms |
| should reset the last column to auto width if only absolute width
columns remain | 893ms | 359ms |
| All tests | 21.069s | 17.338s |


### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [x] [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
@AlexGPlay AlexGPlay added backport:version Backport to applied version labels v9.2.0 and removed backport:skip This PR does not require backporting labels Dec 4, 2025
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 9.2

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

@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 9.2

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

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Dec 4, 2025
## Summary

Closes elastic#234829
Closes elastic#240905
Closes elastic#240904

All 3 tests were timing out so lets try to improve how fast they run -
for this this PR changes from `get/queryByRole` to `get/queryByTestId`
as it speeds up the tests significantly.

Times measured isolating the tests using `it.only` and using the mean
time of 10 runs + mean time of 10 runs of the whole file.

> [!NOTE]
> Both scripts to measure the test times were generated by ChatGPT

Individual tests where measured with this script + `it.only`:
[run-tests.sh](https://github.com/user-attachments/files/23580522/run-tests.sh)
The whole test file was measured using this script:
[all-tests.sh](https://github.com/user-attachments/files/23580737/all-tests.sh)

| Test | Before | After |
|--|--------|------|
| should show the reset width button only for absolute width columns,
and allow resetting to default width | 1268ms | 637ms |
| should not reset the last column to auto width when there are
remaining auto width columns | 894ms | 346ms |
| should reset the last column to auto width if only absolute width
columns remain | 893ms | 359ms |
| All tests | 21.069s | 17.338s |

### Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

- [x] [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

(cherry picked from commit 94c5602)
@kibanamachine
Copy link
Copy Markdown
Contributor

💚 All backports created successfully

Status Branch Result
9.2

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

Questions ?

Please refer to the Backport tool documentation

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Dec 4, 2025
## Summary

Closes elastic#234829
Closes elastic#240905
Closes elastic#240904

All 3 tests were timing out so lets try to improve how fast they run -
for this this PR changes from `get/queryByRole` to `get/queryByTestId`
as it speeds up the tests significantly.

Times measured isolating the tests using `it.only` and using the mean
time of 10 runs + mean time of 10 runs of the whole file.

> [!NOTE]
> Both scripts to measure the test times were generated by ChatGPT

Individual tests where measured with this script + `it.only`:
[run-tests.sh](https://github.com/user-attachments/files/23580522/run-tests.sh)
The whole test file was measured using this script:
[all-tests.sh](https://github.com/user-attachments/files/23580737/all-tests.sh)

| Test | Before | After |
|--|--------|------|
| should show the reset width button only for absolute width columns,
and allow resetting to default width | 1268ms | 637ms |
| should not reset the last column to auto width when there are
remaining auto width columns | 894ms | 346ms |
| should reset the last column to auto width if only absolute width
columns remain | 893ms | 359ms |
| All tests | 21.069s | 17.338s |

### Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

- [x] [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

(cherry picked from commit 94c5602)
@kibanamachine
Copy link
Copy Markdown
Contributor

💚 All backports created successfully

Status Branch Result
9.2

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

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Dec 4, 2025
)

# Backport

This will backport the following commits from `main` to `9.2`:
- [[Unified Data Table] Improve failing test speed
(#243168)](#243168)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Alejandro García
Parrondo","email":"31973472+AlexGPlay@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-11-18T07:17:33Z","message":"[Unified
Data Table] Improve failing test speed (#243168)\n\n## Summary\n\nCloses
https://github.com/elastic/kibana/issues/234829\nCloses
https://github.com/elastic/kibana/issues/240905\nCloses
https://github.com/elastic/kibana/issues/240904\n\nAll 3 tests were
timing out so lets try to improve how fast they run -\nfor this this PR
changes from `get/queryByRole` to `get/queryByTestId`\nas it speeds up
the tests significantly.\n\nTimes measured isolating the tests using
`it.only` and using the mean\ntime of 10 runs + mean time of 10 runs of
the whole file.\n\n> [!NOTE]\n> Both scripts to measure the test times
were generated by ChatGPT\n\nIndividual tests where measured with this
script +
`it.only`:\n[run-tests.sh](https://github.com/user-attachments/files/23580522/run-tests.sh)\nThe
whole test file was measured using this
script:\n[all-tests.sh](https://github.com/user-attachments/files/23580737/all-tests.sh)\n\n|
Test | Before | After |\n|--|--------|------|\n| should show the reset
width button only for absolute width columns,\nand allow resetting to
default width | 1268ms | 637ms |\n| should not reset the last column to
auto width when there are\nremaining auto width columns | 894ms | 346ms
|\n| should reset the last column to auto width if only absolute
width\ncolumns remain | 893ms | 359ms |\n| All tests | 21.069s | 17.338s
|\n\n\n### Checklist\n\nCheck the PR satisfies following conditions.
\n\nReviewers should verify this PR satisfies this list as well.\n\n-
[x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common
scenarios","sha":"94c56027a853d2517c8b475b78814dd5c72c811d","branchLabelMapping":{"^v9.3.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:DataDiscovery","backport:version","v9.2.0","v9.3.0"],"title":"[Unified
Data Table] Improve failing test
speed","number":243168,"url":"https://github.com/elastic/kibana/pull/243168","mergeCommit":{"message":"[Unified
Data Table] Improve failing test speed (#243168)\n\n## Summary\n\nCloses
https://github.com/elastic/kibana/issues/234829\nCloses
https://github.com/elastic/kibana/issues/240905\nCloses
https://github.com/elastic/kibana/issues/240904\n\nAll 3 tests were
timing out so lets try to improve how fast they run -\nfor this this PR
changes from `get/queryByRole` to `get/queryByTestId`\nas it speeds up
the tests significantly.\n\nTimes measured isolating the tests using
`it.only` and using the mean\ntime of 10 runs + mean time of 10 runs of
the whole file.\n\n> [!NOTE]\n> Both scripts to measure the test times
were generated by ChatGPT\n\nIndividual tests where measured with this
script +
`it.only`:\n[run-tests.sh](https://github.com/user-attachments/files/23580522/run-tests.sh)\nThe
whole test file was measured using this
script:\n[all-tests.sh](https://github.com/user-attachments/files/23580737/all-tests.sh)\n\n|
Test | Before | After |\n|--|--------|------|\n| should show the reset
width button only for absolute width columns,\nand allow resetting to
default width | 1268ms | 637ms |\n| should not reset the last column to
auto width when there are\nremaining auto width columns | 894ms | 346ms
|\n| should reset the last column to auto width if only absolute
width\ncolumns remain | 893ms | 359ms |\n| All tests | 21.069s | 17.338s
|\n\n\n### Checklist\n\nCheck the PR satisfies following conditions.
\n\nReviewers should verify this PR satisfies this list as well.\n\n-
[x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common
scenarios","sha":"94c56027a853d2517c8b475b78814dd5c72c811d"}},"sourceBranch":"main","suggestedTargetBranches":["9.2"],"targetPullRequestStates":[{"branch":"9.2","label":"v9.2.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.3.0","branchLabelMappingKey":"^v9.3.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/243168","number":243168,"mergeCommit":{"message":"[Unified
Data Table] Improve failing test speed (#243168)\n\n## Summary\n\nCloses
https://github.com/elastic/kibana/issues/234829\nCloses
https://github.com/elastic/kibana/issues/240905\nCloses
https://github.com/elastic/kibana/issues/240904\n\nAll 3 tests were
timing out so lets try to improve how fast they run -\nfor this this PR
changes from `get/queryByRole` to `get/queryByTestId`\nas it speeds up
the tests significantly.\n\nTimes measured isolating the tests using
`it.only` and using the mean\ntime of 10 runs + mean time of 10 runs of
the whole file.\n\n> [!NOTE]\n> Both scripts to measure the test times
were generated by ChatGPT\n\nIndividual tests where measured with this
script +
`it.only`:\n[run-tests.sh](https://github.com/user-attachments/files/23580522/run-tests.sh)\nThe
whole test file was measured using this
script:\n[all-tests.sh](https://github.com/user-attachments/files/23580737/all-tests.sh)\n\n|
Test | Before | After |\n|--|--------|------|\n| should show the reset
width button only for absolute width columns,\nand allow resetting to
default width | 1268ms | 637ms |\n| should not reset the last column to
auto width when there are\nremaining auto width columns | 894ms | 346ms
|\n| should reset the last column to auto width if only absolute
width\ncolumns remain | 893ms | 359ms |\n| All tests | 21.069s | 17.338s
|\n\n\n### Checklist\n\nCheck the PR satisfies following conditions.
\n\nReviewers should verify this PR satisfies this list as well.\n\n-
[x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common
scenarios","sha":"94c56027a853d2517c8b475b78814dd5c72c811d"}}]}]
BACKPORT-->

Co-authored-by: Alejandro García Parrondo <31973472+AlexGPlay@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment