Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_runner: fix infinite loop when files are undefined in test runner #51047

Merged
merged 1 commit into from
Dec 10, 2023

Conversation

pulkit-30
Copy link
Contributor

fix: #48823

code:

import { run } from 'node:test'
import { tap } from 'node:test/reporters';

const stream = run({ files: undefined }).compose(tap)

stream.pipe(process.stdout);

running without --test flag

TAP version 13
# TAP version 13
# 1..0
# \# tests 0
# \# suites 0
# \# pass 0
# \# fail 0
# \# cancelled 0
# \# skipped 0
# \# todo 0
# \# duration_ms 4.814625
# Subtest: /Users/pulkitgupta/Desktop/node/index.mjs
ok 1 - /Users/pulkitgupta/Desktop/node/index.mjs
  ---
  duration_ms: 68.923583
  ...
1..1
# tests 1
# suites 0
# pass 1
# fail 0
# cancelled 0
# skipped 0
# todo 0
# duration_ms 76.718041

running with --test flag.

TAP version 13
1..0
# tests 0
# suites 0
# pass 0
# fail 0
# cancelled 0
# skipped 0
# todo 0
# duration_ms 5.461375
✔ index.mjs (81.525375ms)
ℹ tests 1
ℹ suites 0
ℹ pass 1
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 93.773375

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/test_runner

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem. labels Dec 4, 2023
@MoLow MoLow added request-ci Add this label to start a Jenkins CI on a PR. author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. labels Dec 6, 2023
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Dec 6, 2023
@nodejs-github-bot
Copy link
Collaborator

@pulkit-30 pulkit-30 changed the title test_runner: infinite loop when files are undefined in run() test_runner: infinite loop when files are undefined in run() Dec 6, 2023
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@MoLow MoLow added the request-ci Add this label to start a Jenkins CI on a PR. label Dec 8, 2023
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Dec 8, 2023
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/56165/

@pulkit-30
Copy link
Contributor Author

Please re request-ci for this pr

@nodejs-github-bot
Copy link
Collaborator

@pulkit-30 pulkit-30 changed the title test_runner: infinite loop when files are undefined in run() test_runner: fix infinite loop when files are undefined in test runner Dec 10, 2023
@MoLow
Copy link
Member

MoLow commented Dec 10, 2023

@pulkit-30 any reason you keep updating the PR? it prevents landing it

@MoLow MoLow added the request-ci Add this label to start a Jenkins CI on a PR. label Dec 10, 2023
@pulkit-30
Copy link
Contributor Author

@pulkit-30 any reason you keep updating the PR? it prevents landing it

Sorry @MoLow, I don’t know that. I was worried about failing ci.

@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Dec 10, 2023
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@MoLow MoLow added the commit-queue Add this label to land a pull request using GitHub Actions. label Dec 10, 2023
@MoLow MoLow removed the commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. label Dec 10, 2023
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Dec 10, 2023
@nodejs-github-bot nodejs-github-bot merged commit f801b58 into nodejs:main Dec 10, 2023
53 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in f801b58

RafaelGSS pushed a commit that referenced this pull request Dec 15, 2023
PR-URL: #51047
Fixes: #48823
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: James M Snell <jasnell@gmail.com>
@RafaelGSS RafaelGSS mentioned this pull request Dec 15, 2023
richardlau pushed a commit that referenced this pull request Mar 25, 2024
PR-URL: #51047
Fixes: #48823
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: James M Snell <jasnell@gmail.com>
@richardlau richardlau mentioned this pull request Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[node:test] Infinite loop occurs when files is empty
5 participants