GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: refactoring and cleanup on child-process tests by jasnell · Pull Request #32078 · nodejs/node

Conversation

@jasnell

@jasnell jasnell commented Mar 3, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Commit 1 in this scratches an itch I've had for a while: it adds a common.debug() to test/common/index.js that uses util.debuglog() as a way of avoiding use of console.log() statements in tests that are not part of the test itself.

To enable the debug output while running tests, set the environment variable NODE_DEBUG=test.

Commit 2 Makes a number of improvements to child process tests including use of the debuglog(), more must calls, and use of ../common/countdown where appropriate.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to Node.js core tests and test infrastructure. label Mar 3, 2020
@jasnell
jasnell force-pushed the test-common-debug branch from 07b1131 to 52df9f5 Compare March 4, 2020 00:06
@gengjiawen

gengjiawen commented Mar 4, 2020

Copy link
Copy Markdown
Member

test parallel/test-child-process-fork-net-server failed.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell

jasnell commented Mar 4, 2020

Copy link
Copy Markdown
Member Author

Interesting... it's passing locally for me. Will investigate.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot

This comment has been minimized.

Sign in to view
@jasnell

jasnell commented Mar 4, 2020

Copy link
Copy Markdown
Member Author

Looks like one of the events in question is not emitted consistently across platforms. Trying again.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot

This comment has been minimized.

Sign in to view
@nodejs-github-bot

This comment has been minimized.

Sign in to view
@nodejs-github-bot

This comment has been minimized.

Sign in to view
@jasnell

jasnell commented Mar 4, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

Ok looks good now. The events in that test definitely are not very consistent. Added some TODO comments to encourage they be looked at again later.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot

This comment has been minimized.

Sign in to view
@nodejs-github-bot

This comment has been minimized.

Sign in to view
@jasnell
jasnell force-pushed the test-common-debug branch from 8b557b8 to 27c8456 Compare March 4, 2020 22:53
@nodejs-github-bot

nodejs-github-bot commented Mar 4, 2020

Copy link
Copy Markdown
Collaborator

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell

jasnell commented Mar 5, 2020

Copy link
Copy Markdown
Member Author

Finally, a good CI run. Turns out the actual emission of events in parallel/test-child-process-fork-net-server is quite flaky from one OS to the next to degree that we cannot make any guarantees about which are going to fire. That's very unfortunate really. I've added todo comments in case someone wishes to get back to it.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell
jasnell requested a review from Trott March 5, 2020 20:19
BridgeAR
BridgeAR reviewed Mar 9, 2020
View reviewed changes
Comment thread test/common/README.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

@BridgeAR BridgeAR mentioned this pull request Mar 9, 2020
tools: add debuglog eslint rule #32161
Closed
4 tasks done
@sam-github

sam-github commented Mar 20, 2020

Copy link
Copy Markdown
Contributor

I assumed this would have landed already, and was just searching for the debug utility, with no luck.

We really need to be able to leave debug messages in tests, ones that normally have no output, but where the output can be turned on.

Every time I have to debug a test I start by injecting console.log statements into them so I know where they are failing... then delete them before PRing. Its not a good way to do things.

If the PR is stalled on the stability of tests, maybe the base feature can be PRed on its own?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cjihrig

cjihrig commented Mar 20, 2020

Copy link
Copy Markdown
Contributor

@sam-github I think it's stalled on this alternate proposal: #32078 (comment)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell

This comment has been minimized.

Sign in to view
@jasnell
test: refactoring / cleanup on child-process tests
bd51d52
@jasnell
jasnell force-pushed the test-common-debug branch from 27c8456 to bd51d52 Compare March 23, 2020 20:07
@jasnell jasnell changed the title test: add common.debug utility and improve child_process tests test: refactoring and cleanup on child-process tests Mar 23, 2020
@jasnell

jasnell commented Mar 23, 2020

Copy link
Copy Markdown
Member Author

Went head and removed the common.debug() from this PR to allow the improvements in the tests to move forward.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot

nodejs-github-bot commented Mar 23, 2020

Copy link
Copy Markdown
Collaborator

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gireeshpunathil
gireeshpunathil approved these changes Mar 24, 2020
View reviewed changes
jasnell added a commit that referenced this pull request Mar 24, 2020
@jasnell
test: refactoring / cleanup on child-process tests
d0c0e20
PR-URL: #32078
Reviewed-By: Gireesh Punathil <[email protected]>
@jasnell

jasnell commented Mar 24, 2020

Copy link
Copy Markdown
Member Author

Landed in d0c0e20

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell jasnell closed this Mar 24, 2020
MylesBorins pushed a commit that referenced this pull request Mar 25, 2020
@jasnell @MylesBorins
test: refactoring / cleanup on child-process tests
07e4131
PR-URL: #32078
Reviewed-By: Gireesh Punathil <[email protected]>
@MylesBorins MylesBorins mentioned this pull request Mar 25, 2020
v13.12.0 proposal #32376
Merged
@targos targos added backport-blocked-v12.x and removed backport-blocked-v12.x labels Apr 22, 2020
targos pushed a commit to targos/node that referenced this pull request Apr 25, 2020
@jasnell @targos
test: refactoring / cleanup on child-process tests
be92b25
PR-URL: nodejs#32078
Reviewed-By: Gireesh Punathil <[email protected]>
targos pushed a commit that referenced this pull request Apr 28, 2020
@jasnell @targos
test: refactoring / cleanup on child-process tests
e3baee6
PR-URL: #32078
Reviewed-By: Gireesh Punathil <[email protected]>
@targos targos mentioned this pull request May 2, 2020
v12.17.0 release proposal #33197
Merged
targos pushed a commit that referenced this pull request May 10, 2020
@BridgeAR @targos
tools: add eslint rule to only pass through 'test' to debuglog
36b2e25
This makes sure all usages of `util.debuglog()` must contain the
string 'test' as argument.

PR-URL: #32161
Refs: #32078
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
targos pushed a commit that referenced this pull request May 10, 2020
@BridgeAR @targos
tools: remove obsolete no-restricted-syntax eslint rules
1858472
These rules only apply for the test folder and will already be
checked for.

PR-URL: #32161
Refs: #32078
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
codebytere pushed a commit that referenced this pull request May 11, 2020
@BridgeAR @codebytere
tools: add eslint rule to only pass through 'test' to debuglog
804982c
This makes sure all usages of `util.debuglog()` must contain the
string 'test' as argument.

PR-URL: #32161
Refs: #32078
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
codebytere pushed a commit that referenced this pull request May 11, 2020
@BridgeAR @codebytere
tools: remove obsolete no-restricted-syntax eslint rules
cf03fe5
These rules only apply for the test folder and will already be
checked for.

PR-URL: #32161
Refs: #32078
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
codebytere pushed a commit that referenced this pull request Jun 7, 2020
@BridgeAR @codebytere
tools: add eslint rule to only pass through 'test' to debuglog
5d5e66c
This makes sure all usages of `util.debuglog()` must contain the
string 'test' as argument.

PR-URL: #32161
Refs: #32078
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
codebytere pushed a commit that referenced this pull request Jun 7, 2020
@BridgeAR @codebytere
tools: remove obsolete no-restricted-syntax eslint rules
cdd7d3a
These rules only apply for the test folder and will already be
checked for.

PR-URL: #32161
Refs: #32078
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@BridgeAR BridgeAR BridgeAR left review comments
@gireeshpunathil gireeshpunathil gireeshpunathil approved these changes
@Trott Trott Awaiting requested review from Trott
+1 more reviewer
@sam-github sam-github sam-github left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

test Issues and PRs related to Node.js core tests and test infrastructure.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

9 participants

@jasnell @gengjiawen @nodejs-github-bot @sam-github @cjihrig @Trott @gireeshpunathil @BridgeAR @targos
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.