test: deflake util.throttle tests · nodejs/node@e90575c · GitHub
Skip to content

Commit e90575c

Browse files
panvaaduh95
authored andcommitted
test: deflake util.throttle tests
Short throttle windows can expire between synchronous calls when the process is descheduled. Delayed timer dispatch can also release two queued calls together, invalidating the strict test's spacing assertion. Move timing checks to a separate test with mocked timers and a matching libuv clock. Cover both punctual and delayed dispatch, and keep real async_hooks timer-allocation checks with windows canceled before expiry. Signed-off-by: Filip Skokan <panva.ip@gmail.com> Assisted-by: Codex PR-URL: #66034 Refs: #65899 Refs: https://ci.nodejs.org/job/node-test-commit-linux-containered/nodes=ubuntu2404_sharedlibs_openssl111_x64/59189/ Refs: https://ci.nodejs.org/job/node-test-commit-linuxone/nodes=rhel8-s390x/58602/ Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Stefan Stojanovic <stefan.stojanovic@janeasystems.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
1 parent 3ce4d23 commit e90575c

2 files changed

Lines changed: 181 additions & 113 deletions

File tree

Lines changed: 170 additions & 0 deletions

‎test/parallel/test-util-throttle.js‎

Lines changed: 11 additions & 113 deletions

0 commit comments

Comments
 (0)