Skip to content

test_runner: add support for mocking setImmediate timer - #49397

Merged
nodejs-github-bot merged 5 commits into
nodejs:mainfrom
ErickWendel:test_runner/add-setImmediate-to-mock-timers
Aug 31, 2023
Merged

test_runner: add support for mocking setImmediate timer#49397
nodejs-github-bot merged 5 commits into
nodejs:mainfrom
ErickWendel:test_runner/add-setImmediate-to-mock-timers

Conversation

@ErickWendel

@ErickWendelErickWendel commented Aug 29, 2023

Copy link
Copy Markdown
Member

This PR adds support for

  • - setImmediate
  • - timers.setImmediate
  • - timers.promises.setImmediate

This PR makes sure that setImmediate has priority higher than setTimeout and follows the spec defined in the docs about:
When multiple calls to setImmediate() are made, the callback functions are queued for execution in the order in which they are created

cc: @nodejs/test_runner

@ErickWendelErickWendel self-assigned this Aug 29, 2023
@nodejs-github-bot

nodejs-github-bot commented Aug 29, 2023

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/test_runner

@nodejs-github-botnodejs-github-bot added needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem. labels Aug 29, 2023
@ErickWendelErickWendel changed the title test_runner: add support for setImmediatetest_runner: add support for mocking setImmediate timerAug 29, 2023
Comment threaddoc/api/test.md Outdated
Comment threaddoc/api/test.md
Co-authored-by: CW <cwunder@gnome.org>
Comment threaddoc/api/test.md Outdated
Comment threadtest/parallel/test-runner-mock-timers.js Outdated
Comment threadtest/parallel/test-runner-mock-timers.js Outdated
Signed-off-by: Erick Wendel <erick.workspace@gmail.com>
Signed-off-by: Erick Wendel <erick.workspace@gmail.com>
@tniessentniessen added the experimental Issues and PRs related to experimental features. label Aug 29, 2023
Comment threaddoc/api/test.md Outdated
Comment threadlib/internal/test_runner/mock/mock_timers.js
Comment threadlib/internal/test_runner/mock/mock_timers.js Outdated
@ErickWendelErickWendel added request-ci Add this label to start a Jenkins CI on a PR. commit-queue Add this label to land a pull request using GitHub Actions. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. labels Aug 30, 2023
@github-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 30, 2023
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Co-authored-by: Jordan Harband <ljharb@gmail.com>
Co-authored-by: Moshe Atlow <moshe@atlow.co.il>
@ErickWendel
ErickWendelforce-pushed the test_runner/add-setImmediate-to-mock-timers branch from c1323df to 962e14aCompareAugust 30, 2023 17:04
@ErickWendelErickWendel added request-ci Add this label to start a Jenkins CI on a PR. and removed commit-queue Add this label to land a pull request using GitHub Actions. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. labels Aug 30, 2023
@github-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 30, 2023
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@atlowChemiatlowChemi added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Aug 31, 2023
@atlowChemiatlowChemi added commit-queue Add this label to land a pull request using GitHub Actions. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. labels Aug 31, 2023
@nodejs-github-botnodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 31, 2023
@nodejs-github-bot
nodejs-github-bot merged commit c750049 into nodejs:mainAug 31, 2023
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in c750049

UlisesGascon pushed a commit that referenced this pull request Sep 10, 2023
PR-URL: #49397
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
@UlisesGasconUlisesGascon mentioned this pull request Sep 10, 2023
targos pushed a commit that referenced this pull request Nov 27, 2023
PR-URL: #49397
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
@targostargos mentioned this pull request Nov 28, 2023
sercher added a commit to sercher/graaljs that referenced this pull request Apr 25, 2024
PR-URL: nodejs/node#49397
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
sercher added a commit to sercher/graaljs that referenced this pull request Apr 25, 2024
PR-URL: nodejs/node#49397
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.commit-queue-squashAdd this label to instruct the Commit Queue to squash all the PR commits into the first one.experimentalIssues and PRs related to experimental features.needs-ciPRs that need a full CI run.test_runnerIssues and PRs related to the test runner subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants

@ErickWendel@nodejs-github-bot@ljharb@benjamingr@MoLow@ovflowd@RafaelGSS@atlowChemi@tniessen