Skip to content

test: use awaitable apm.flush() in undici tests - #5168

Merged
trentm merged 2 commits into
elastic:mainfrom
atharv-sys32:use-awaitable-flush
Aug 6, 2026
Merged

test: use awaitable apm.flush() in undici tests#5168
trentm merged 2 commits into
elastic:mainfrom
atharv-sys32:use-awaitable-flush

Conversation

@atharv-sys32

Copy link
Copy Markdown
Contributor

Closes #3176.

apm.flush() is now natively awaitable (added in #3167), so the promisify(apm.flush.bind(apm)) wrappers in the undici tests can be replaced with direct await apm.flush() calls. This removes the leftover promisify imports too.

Verified locally: both test files pass (undici.test.js 83/83, fetch.test.js 17/17) and eslint is clean.

Signed-off-by: Atharv Pandey <atharvpandey245@gmail.com>
@atharv-sys32
atharv-sys32 requested a review from a team as a code owner August 3, 2026 09:35
@cla-checker-service

cla-checker-service Bot commented Aug 3, 2026

Copy link
Copy Markdown

💚 CLA has been signed

@atharv-sys32

Copy link
Copy Markdown
Contributor Author

Hi @david-luna @trentm, quick note on this one. It closes #3176 by switching the undici tests to the now-awaitable apm.flush() and dropping the promisify wrappers. Both test files pass locally and eslint is clean. Would appreciate a review when you have a moment.

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

🤖 GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

Signed-off-by: Atharv Pandey <atharvpandey245@gmail.com>
@trentm

trentm commented Aug 6, 2026

Copy link
Copy Markdown
Member

Thanks!

@trentm
trentm merged commit 2af6ab1 into elastic:main Aug 6, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

use newly awaitable agent.flush() in tests

2 participants