Skip to content

test (eventsource): refactor tests for eventsource, speed them up#4493

Merged
Uzlopak merged 8 commits intomainfrom
speed-up-eventsource-test
Aug 31, 2025
Merged

test (eventsource): refactor tests for eventsource, speed them up#4493
Uzlopak merged 8 commits intomainfrom
speed-up-eventsource-test

Conversation

@Uzlopak
Copy link
Contributor

@Uzlopak Uzlopak commented Aug 31, 2025

  • use tspl with plan instead of a custom deferredPromise logic
  • use FakeTimers instead of waiting
  • condense the logic

Reduces the time to test from about 11 seconds to round about 1s.

This relates to...

Rationale

Changes

Features

Bug Fixes

Breaking Changes and Deprecations

Status

@Uzlopak Uzlopak merged commit 1d0e343 into main Aug 31, 2025
34 of 36 checks passed
@Uzlopak Uzlopak deleted the speed-up-eventsource-test branch August 31, 2025 16:47
@github-actions github-actions bot mentioned this pull request Sep 9, 2025
slagiewka pushed a commit to slagiewka/undici that referenced this pull request Feb 14, 2026
…dejs#4493)

* reduce time for test/eventsource/eventsource-close.js

* import once properly, use createDeferredPromise

* use createDeferredPromise in eventsource-reconnect.js

* optimize further

* improve eventsource-reconnect.js

* improve time of eventsource-message

* reduce lines

* use tspl instead of createDeferredPromise
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants