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 — [v12.x backport] test: refactor common.expectsError by sxa · Pull Request #31449 · nodejs/node

Conversation

@sxa

@sxa sxa commented Jan 21, 2020 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

Ever had one of those moments when you wish you hadn't started a backport but wanted to see it through to completion? I'm glad this is done now and it'll definitely make subsequent backports easer (would have helped for the other one I did this evening). Understandable there are quite a few adjustments in this due to differences in test cases between v12.x and master which meant that many fixups were required, but this now passes the tests.

I've only verified that this is ok on xLinux.

If someone can kick off the test-commit job that would be appreciated.

For reviewers, it's probably fairly obvious but the "fixup" commit in here contains most of the changes I had to make manually (plus a couple of typo fixes from my first merge resolution)

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 addons Issues and PRs related to native addons. async_hooks Issues and PRs related to the async hooks subsystem. esm Issues and PRs related to the ECMAScript Modules implementation. test Issues and PRs related to Node.js core tests and test infrastructure. v12.x labels Jan 21, 2020
@sxa
sxa requested review from BridgeAR and targos January 21, 2020 22:06
@nodejs-github-bot

nodejs-github-bot commented Jan 21, 2020

Copy link
Copy Markdown
Collaborator

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

All reactions

Sorry, something went wrong.

Uh oh!

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

@sxa

sxa commented Jan 21, 2020

Copy link
Copy Markdown
Member Author

https://ci.nodejs.org/job/node-test-commit-linux/nodes=centos7-64-gcc6/32389/consoleFull (Thanks @BethGriggs for kicking it off) failed the PR test job due to the failure shown below with test-http2-reset-fllood. Since this PR only changes tests it seems likely that this is a machine specific issue, or I was just unlucky on an intermittent test (It's known flakey on FreeBSD as per #29802 - perhaps #30534 will assist with this - although if it's already been backported - it's called out in #31368 - then perhaps that hasn't fixed it!). Other platforms/Linux distributions that have completed as I write this have not failed in the same way as per https://ci.nodejs.org/job/node-test-commit/35039/console

22:28:15 not ok 1169 parallel/test-http2-reset-flood
22:28:15   ---
22:28:15   duration_ms: 0.328
22:28:15   severity: fail
22:28:15   exitcode: 1
22:28:15   stack: |-
22:28:15     events.js:298
22:28:15           throw er; // Unhandled 'error' event
22:28:15           ^
22:28:15     
22:28:15     Error: This socket has been ended by the other party
22:28:15         at Socket.writeAfterFIN [as write] (net.js:451:14)
22:28:15         at Immediate.writeRequests (/home/iojs/build/workspace/node-test-commit-linux/nodes/centos7-64-gcc6/test/parallel/test-http2-reset-flood.js:72:12)
22:28:15         at processImmediate (internal/timers.js:456:21)
22:28:15     Emitted 'error' event on Socket instance at:
22:28:15         at emitErrorNT (net.js:1336:8)
22:28:15         at processTicksAndRejections (internal/process/task_queues.js:84:21) {
22:28:15       code: 'EPIPE'
22:28:15     }
22:28:15   ...
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 Jan 21, 2020

Copy link
Copy Markdown
Collaborator

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

All reactions

Sorry, something went wrong.

Uh oh!

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

@sxa
sxa force-pushed the v12.x-31092 branch from f9fa225 to 2bd7704 Compare January 22, 2020 11:50
@nodejs-github-bot

nodejs-github-bot commented Jan 22, 2020

Copy link
Copy Markdown
Collaborator

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

All reactions

Sorry, something went wrong.

Uh oh!

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

BridgeAR
BridgeAR approved these changes Jan 22, 2020
View reviewed changes
Comment thread test/parallel/test-stream-unshift-read-race.js Resolved

Uh oh!

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

Comment thread test/parallel/test-fs-whatwg-url.js Resolved

Uh oh!

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

Comment thread test/parallel/test-crypto.js Resolved

Uh oh!

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

@sxa
sxa force-pushed the v12.x-31092 branch 5 times, most recently from 44a6565 to 9f59f39 Compare January 22, 2020 13:44
@sxa

sxa commented Jan 22, 2020

Copy link
Copy Markdown
Member Author

All comments addressed @BridgeAR if you want to take another look.

All reactions

Sorry, something went wrong.

Uh oh!

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

@sxa

sxa commented Jan 22, 2020 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member Author

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

This passed although doesn't include my latest (minor) tweak to address review comments

All reactions

Sorry, something went wrong.

Uh oh!

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

@MylesBorins
MylesBorins force-pushed the v12.x-31092 branch from 9f59f39 to a7afcbb Compare January 30, 2020 23:12
@MylesBorins

MylesBorins commented Jan 30, 2020

Copy link
Copy Markdown
Contributor

I've rebased against v12.x to fixed conflicts.

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 Jan 30, 2020

Copy link
Copy Markdown
Collaborator

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

All reactions

Sorry, something went wrong.

Uh oh!

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

@BethGriggs
BethGriggs force-pushed the v12.x-staging branch from 67ec97a to fc7b27e Compare February 6, 2020 02:51
@guybedford guybedford removed the esm Issues and PRs related to the ECMAScript Modules implementation. label Mar 12, 2020
@codebytere
codebytere force-pushed the v12.x-staging branch from a01fb4a to e5dc2fb Compare March 23, 2020 16:01
@codebytere
codebytere force-pushed the v12.x-staging branch 2 times, most recently from 63a03d2 to d577190 Compare March 31, 2020 23:57
@BridgeAR @MylesBorins
test: refactor common.expectsError
7e1c8e6
This completely refactors the `expectsError` behavior: so far it's
almost identical to `assert.throws(fn, object)` in case it was used
with a function as first argument. It had a magical property check
that allowed to verify a functions `type` in case `type` was passed
used in the validation object. This pattern is now completely removed
and `assert.throws()` should be used instead.

The main intent for `common.expectsError()` is to verify error cases
for callback based APIs. This is now more flexible by accepting all
validation possibilites that `assert.throws()` accepts as well. No
magical properties exist anymore. This reduces surprising behavior
for developers who are not used to the Node.js core code base.

This has the side effect that `common` is used significantly less
frequent.

Backport-PR-URL: nodejs#31449
PR-URL: nodejs#31092
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
@MylesBorins
MylesBorins force-pushed the v12.x-31092 branch from a7afcbb to 7e1c8e6 Compare April 1, 2020 06:21
@MylesBorins

MylesBorins commented Apr 1, 2020

Copy link
Copy Markdown
Contributor

rebased

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 Apr 1, 2020 •
edited by MylesBorins
Loading

Uh oh!

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

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/30315/
Rerun bsd: https://ci.nodejs.org/job/node-test-commit-freebsd/32478/

All reactions

Sorry, something went wrong.

Uh oh!

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

@MylesBorins

MylesBorins commented Apr 1, 2020

Copy link
Copy Markdown
Contributor

BSD failure might be known flake

#29802
#32595

All reactions

Sorry, something went wrong.

Uh oh!

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

MylesBorins pushed a commit that referenced this pull request Apr 1, 2020
@BridgeAR @MylesBorins
test: refactor common.expectsError
d568efc
This completely refactors the `expectsError` behavior: so far it's
almost identical to `assert.throws(fn, object)` in case it was used
with a function as first argument. It had a magical property check
that allowed to verify a functions `type` in case `type` was passed
used in the validation object. This pattern is now completely removed
and `assert.throws()` should be used instead.

The main intent for `common.expectsError()` is to verify error cases
for callback based APIs. This is now more flexible by accepting all
validation possibilites that `assert.throws()` accepts as well. No
magical properties exist anymore. This reduces surprising behavior
for developers who are not used to the Node.js core code base.

This has the side effect that `common` is used significantly less
frequent.

Backport-PR-URL: #31449
PR-URL: #31092
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
@MylesBorins

MylesBorins commented Apr 1, 2020

Copy link
Copy Markdown
Contributor

landed in d568efc

All reactions

Sorry, something went wrong.

Uh oh!

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

@MylesBorins MylesBorins closed this Apr 1, 2020
@sxa

sxa commented Apr 1, 2020 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member Author

Thanks @MylesBorins - I hadn't got back to doing the rebase after the release went out as it looked rather non-trivial to redo with the modified history on this one, but should be a good one to get in.

All reactions

Sorry, something went wrong.

Uh oh!

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

@MylesBorins

MylesBorins commented Apr 1, 2020

Copy link
Copy Markdown
Contributor

@sxa555 it is landed and in!

FWIW I made a new branch off of staging and cherry-picked your initial commit (rather than rebasing). There was only a single conflict, so it was rather straight forward all things considered

sxa reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@BridgeAR BridgeAR BridgeAR approved these changes
@targos targos Awaiting requested review from targos

Uh oh!

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

Assignees

No one assigned

Labels

addons Issues and PRs related to native addons. async_hooks Issues and PRs related to the async hooks subsystem. 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.

5 participants

@sxa @nodejs-github-bot @MylesBorins @BridgeAR @guybedford
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.