Skip to content

[eslint_with_types] extend file patterns + checkThenables#234520

Merged
dmlemeshko merged 6 commits intoelastic:mainfrom
dmlemeshko:improve-floating-promises-check
Sep 11, 2025
Merged

[eslint_with_types] extend file patterns + checkThenables#234520
dmlemeshko merged 6 commits intoelastic:mainfrom
dmlemeshko:improve-floating-promises-check

Conversation

@dmlemeshko
Copy link
Copy Markdown
Contributor

@dmlemeshko dmlemeshko commented Sep 10, 2025

Summary

This PR extends the file patterns for the @typescript-eslint/no-floating-promises ESLint rule to cover more test files. Missing await has repeatedly caused test flakiness, so improving automated tracking is important.

With the recent test relocations, we can now apply this rule repo-wide. Several test files were also updated to add missing await in async function calls.

@dmlemeshko dmlemeshko self-assigned this Sep 10, 2025
'error',
{
ignoreIIFE: false,
checkThenables: true, // check for thenable objects (not just native Promises)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It turns out we won't catch without it a missing await in the test code like this:

      supertest
        .post(`/api/console/proxy?method=GET&path=${encodeURIComponent('/_cat')}`)
        .set('kbn-xsrf', 'xxx')
        .send()
        .expect(401);

'*spaces_api_integration/common/services/basic_auth_supertest.ts',
// TODO: high chances missing awaits cause test flakiness, 37 errors spotted
'x-pack/solutions/security/test/security_solution_api_integration/**/*'],
'*security_solution_api_integration/scripts/mki_api_ftr_execution.ts',
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I checked that this script is fine not to have await before run call

@dmlemeshko dmlemeshko 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 labels Sep 10, 2025
@dmlemeshko dmlemeshko requested a review from afharo September 10, 2025 08:37
@dmlemeshko dmlemeshko marked this pull request as ready for review September 10, 2025 09:05
@dmlemeshko dmlemeshko requested review from a team as code owners September 10, 2025 09:05
Copy link
Copy Markdown
Contributor

@jughosta jughosta left a comment

Choose a reason for hiding this comment

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

Changes in Data Discovery tests LGTM

@dmlemeshko dmlemeshko enabled auto-merge (squash) September 11, 2025 10:21
@dmlemeshko dmlemeshko merged commit 6fb6818 into elastic:main Sep 11, 2025
13 checks passed
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 8.18, 8.19, 9.0, 9.1

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

@elasticmachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

✅ unchanged

History

cc @dmlemeshko

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Sep 11, 2025
…4520)

## Summary

This PR extends the file patterns for the
`@typescript-eslint/no-floating-promises` ESLint rule to cover more test
files. Missing `await` has repeatedly caused test flakiness, so
improving automated tracking is important.

With the recent test relocations, we can now apply this rule repo-wide.
Several test files were also updated to add missing `await` in async
function calls.

(cherry picked from commit 6fb6818)
@kibanamachine
Copy link
Copy Markdown
Contributor

💔 Some backports could not be created

Status Branch Result
8.18 Backport failed because of merge conflicts
8.19 Backport failed because of merge conflicts

You might need to backport the following PRs to 8.19:
- [ska] relocation security_solution_* FTR tests (#231416)
9.0 Backport failed because of merge conflicts
9.1

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

Manual backport

To create the backport manually run:

node scripts/backport --pr 234520

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Sep 11, 2025
) (#234749)

# Backport

This will backport the following commits from `main` to `9.1`:
- [[eslint_with_types] extend file patterns + checkThenables
(#234520)](#234520)

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

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

<!--BACKPORT [{"author":{"name":"Dzmitry
Lemechko","email":"dzmitry.lemechko@elastic.co"},"sourceCommit":{"committedDate":"2025-09-11T12:33:06Z","message":"[eslint_with_types]
extend file patterns + checkThenables (#234520)\n\n## Summary\n\nThis PR
extends the file patterns for
the\n`@typescript-eslint/no-floating-promises` ESLint rule to cover more
test\nfiles. Missing `await` has repeatedly caused test flakiness,
so\nimproving automated tracking is important.\n\nWith the recent test
relocations, we can now apply this rule repo-wide.\nSeveral test files
were also updated to add missing `await` in async\nfunction
calls.","sha":"6fb6818b2cebfea82765fe8efd92c7ec42c7ec8d","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:all-open","v9.2.0"],"title":"[eslint_with_types]
extend file patterns +
checkThenables","number":234520,"url":"https://github.com/elastic/kibana/pull/234520","mergeCommit":{"message":"[eslint_with_types]
extend file patterns + checkThenables (#234520)\n\n## Summary\n\nThis PR
extends the file patterns for
the\n`@typescript-eslint/no-floating-promises` ESLint rule to cover more
test\nfiles. Missing `await` has repeatedly caused test flakiness,
so\nimproving automated tracking is important.\n\nWith the recent test
relocations, we can now apply this rule repo-wide.\nSeveral test files
were also updated to add missing `await` in async\nfunction
calls.","sha":"6fb6818b2cebfea82765fe8efd92c7ec42c7ec8d"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/234520","number":234520,"mergeCommit":{"message":"[eslint_with_types]
extend file patterns + checkThenables (#234520)\n\n## Summary\n\nThis PR
extends the file patterns for
the\n`@typescript-eslint/no-floating-promises` ESLint rule to cover more
test\nfiles. Missing `await` has repeatedly caused test flakiness,
so\nimproving automated tracking is important.\n\nWith the recent test
relocations, we can now apply this rule repo-wide.\nSeveral test files
were also updated to add missing `await` in async\nfunction
calls.","sha":"6fb6818b2cebfea82765fe8efd92c7ec42c7ec8d"}}]}]
BACKPORT-->

Co-authored-by: Dzmitry Lemechko <dzmitry.lemechko@elastic.co>
KodeRad pushed a commit to KodeRad/kibana that referenced this pull request Sep 15, 2025
…4520)

## Summary

This PR extends the file patterns for the
`@typescript-eslint/no-floating-promises` ESLint rule to cover more test
files. Missing `await` has repeatedly caused test flakiness, so
improving automated tracking is important.

With the recent test relocations, we can now apply this rule repo-wide.
Several test files were also updated to add missing `await` in async
function calls.
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Sep 24, 2025
…4520)

## Summary

This PR extends the file patterns for the
`@typescript-eslint/no-floating-promises` ESLint rule to cover more test
files. Missing `await` has repeatedly caused test flakiness, so
improving automated tracking is important.

With the recent test relocations, we can now apply this rule repo-wide.
Several test files were also updated to add missing `await` in async
function calls.
niros1 pushed a commit that referenced this pull request Sep 30, 2025
## Summary

This PR extends the file patterns for the
`@typescript-eslint/no-floating-promises` ESLint rule to cover more test
files. Missing `await` has repeatedly caused test flakiness, so
improving automated tracking is important.

With the recent test relocations, we can now apply this rule repo-wide.
Several test files were also updated to add missing `await` in async
function calls.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:all-open Backport to all branches that could still receive a release release_note:skip Skip the PR/issue when compiling release notes v9.1.4 v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants