| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
@jasnell I wasn't able to get the tests to pass... Path: parallel/test-stream-unshift-read-race
ok
assert.js:621
throw actual;
^
Error [ERR_STREAM_PUSH_AFTER_EOF]: stream.push() after EOF
at readableAddChunk (_stream_readable.js:244:30)
at Readable.push (_stream_readable.js:212:10)
at /Users/benhalverson/projects/node/test/parallel/test-stream-unshift-read-race.js:72:7
at tryBlock (assert.js:591:5)
at innerThrows (assert.js:610:18)
at Function.throws (assert.js:637:3)
at pushError (/Users/benhalverson/projects/node/test/parallel/test-stream-unshift-read-race.js:71:10)
at Timeout._onTimeout (/Users/benhalverson/projects/node/test/parallel/test-stream-unshift-read-race.js:64:25)
at ontimeout (timers.js:469:11)
at tryOnTimeout (timers.js:304:5)
Command: out/Release/node /Users/benhalverson/projects/node/test/parallel/test-stream-unshift-read-race.js
[02:20|% 100|+ 1799|- 1]: Done
make: *** [test] Error 1
my attempt... function pushError() {
assert.throws(function() {
r.push(Buffer.allocUnsafe(1));
}, /^ERR_STREAM_PUSH_AFTER_EOF$/);
}
const w = stream.Writable();
const written = [];
w._write = function(chunk, encoding, cb) {
written.push(chunk.toString());
cb();
};
r.on('end', common.mustCall(function() {
assert.throws(function() {
r.unshift(Buffer.allocUnsafe(1));
}, /^ERR_STREAM_UNSHIFT_AFTER_END_EVENT$/);
w.end();
}));
|
Sorry, something went wrong.
|
As stated elsewhere, I'm very 👎 on this change until we have a clear strategy on how to keep the same behavior on readable-stream (it needs to support old browsers were inheriting from Error does not work as expected). |
Sorry, something went wrong.
|
@mcollina thanks for the feedback. |
Sorry, something went wrong.
|
Hello @benhalverson and welcome. Thank you for the contribution 🥇 I've marked it as blocked until a compatibility strategy is finalized. |
Sorry, something went wrong.
There was a problem hiding this comment.
Can you please put this in alphabetical order :-) thank you!
Also, I believe these need line wrapped at 80 chars. Run make lint to check
Sorry, something went wrong.
There was a problem hiding this comment.
s/ERR_UNDERSCORE_READ_NOT_IMPLEMENTED/ERR_STREAM_READ_NOT_IMPLEMENTED
Sorry, something went wrong.
There was a problem hiding this comment.
s/ERR_END_READABLE_CALLED_ON_NONEMPTY_STREAM/ERR_STREAM_READABLE_CALLED_ON_NONEMPTY
Sorry, something went wrong.
|
To explain @refack's comments a bit more. The streams module in core is kept in sync with the standalone readable-streams module. Because of that, any changes to the streams code must be kept in sync with that module. Because the internal/errors bit is very specific to Node.js core, we have not started migrating the streams code over to use it. |
Sorry, something went wrong.
|
At the latest streams wg we decided to unblock this. We would like this (and the equals for Writable, Duplex and Transform) to ship in Node 9. |
Sorry, something went wrong.
|
@benhalverson I think you can use common.expectsError to check for the error code: https://github.com/nodejs/node/blob/master/test/common/index.js#L696. See https://github.com/nodejs/node/blob/c2e838ee13244dd3dbd98ed86ef1966fe7cd90f1/test/parallel/test-require-invalid-package.js as an example. |
Sorry, something went wrong.
|
Thanks @mcollina I'll take a look at the example |
Sorry, something went wrong.
|
@benhalverson what is the status of this? Would you mind updating to common.expectsError({ code: 'CODE' })? |
Sorry, something went wrong.
There was a problem hiding this comment.
why is this commented out?
Sorry, something went wrong.
There was a problem hiding this comment.
I was testing and forgot to uncomment
Sorry, something went wrong.
There was a problem hiding this comment.
I could use some assistance on this test...
current test
function pushError() {
assert.throws(function() {
r.push(Buffer.allocUnsafe(1));
}, /^ERR_STREAM_PUSH_AFTER_EOF/);
}
What I have tried so far:
function pushError() {
common.expectsError({
code: 'ERR_STREAM_PUSH_AFTER_EOF',
message: 'stream.push() after EOF'
});
}
This gives the following error.
Path: parallel/test-stream-unshift-read-race
ok
events.js:182
throw er; // Unhandled 'error' event
^
Error: stream.push() after EOF
at readableAddChunk (_stream_readable.js:243:30)
at Readable.push (_stream_readable.js:211:10)
at pushError (/Users/benhalverson/projects/node/test/parallel/test-stream-unshift-read-race.js:77:9)
at Timeout._onTimeout (/Users/benhalverson/projects/node/test/parallel/test-stream-unshift-read-race.js:64:25)
at ontimeout (timers.js:471:11)
at tryOnTimeout (timers.js:305:5)
at Timer.listOnTimeout (timers.js:265:5)
Without r.push(Buffer.allocUnsafe(1)); I get this error.
Path: parallel/test-stream-unshift-read-race
Mismatched <anonymous> function calls. Expected exactly 1, actual 0.
at Object.exports.mustCall (/Users/benhalverson/projects/node/test/common/index.js:482:10)
at Object.expectsError (/Users/benhalverson/projects/node/test/common/index.js:707:27)
at pushError (/Users/benhalverson/projects/node/test/parallel/test-stream-unshift-read-race.js:78:14)
at Timeout._onTimeout (/Users/benhalverson/projects/node/test/parallel/test-stream-unshift-read-race.js:64:25)
at ontimeout (timers.js:471:11)
at tryOnTimeout (timers.js:305:5)
at Timer.listOnTimeout (timers.js:265:5)
0: asdfasdfas
1: 1234dfasdf
2: 1234asdfas
3: 1234dfasdf
4: 1234asdfas
5: 1234dfasdf
6: 1234asdfas
7: 1234dfasdf
8: 1234asdfas
9: 1234dfasdf
a: 1234asdfas
b: 1234dfasdf
c: 1234asdfas
d: 1234dfasdf
e: 1234asdfas
f: 1234dfasdf
g: 1234asdfa
h: 1234
Sorry, something went wrong.
There was a problem hiding this comment.
I figured it out @mcollina. Reading the docs helped 👍 https://github.com/nodejs/node/blob/master/doc/guides/using-internal-errors.md
Sorry, something went wrong.
|
Something went wrong with your latest git operations. Can you please rebase? |
Sorry, something went wrong.
|
I would recommend that you take the changes you have done, start with a fresh branch, and do a force push here. |
Sorry, something went wrong.
|
I was thinking the same... I did the rebase got a bunch of conflicts and it ended up like this after I fixed the conflicts ¯_(ツ)_/¯ |
Sorry, something went wrong.
|
@benhalverson against what branch did you rebase? I am not sure how you set up your clone but I guess you should rebase like git rebase -i upstream/master. |
Sorry, something went wrong.
|
@BridgeAR I used my local version of node and rebased against upstream/master. |
Sorry, something went wrong.
There was a problem hiding this comment.
can you use common.expectsError here as well?
Sorry, something went wrong.
There was a problem hiding this comment.
I've updated this test
Sorry, something went wrong.
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM with a nit
Sorry, something went wrong.
There was a problem hiding this comment.
This should be ERR_STREAM_ENDREADABLE_CALLED_ON_NONEMPTY.
Sorry, something went wrong.
There was a problem hiding this comment.
I've updated this line
Sorry, something went wrong.
There was a problem hiding this comment.
There is the error code to be changed, I'm moving my feedback to "request changes" instead of approved.
Sorry, something went wrong.
There was a problem hiding this comment.
Please remove the empty template string.
Sorry, something went wrong.
There was a problem hiding this comment.
Just as a suggestion - it would be nicer to use
common.expectsError(throwingFn, errorObj)
// instead of
assert.throws(throwingFn, common.expectsError(errorObj))
Sorry, something went wrong.
There was a problem hiding this comment.
A empty template string?
Sorry, something went wrong.
|
Oops 😂 |
Sorry, something went wrong.
|
@mcollina is there anything else I need to change? |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
|
Looks like the CI job had conflicts even though the PR says it can be merge automatically. @benhalverson could you squash the commits down 1 one (I'm thinking maybe something that is added/them removed is the source of the conflicts) and then we can run the CI again. |
Sorry, something went wrong.
|
I have went ahead and squashed the commits in this PR. CI: https://ci.nodejs.org/job/node-test-pull-request/11041/ |
Sorry, something went wrong.
|
Oh, this feature is nice: https://ci.nodejs.org/job/node-test-linter/13033/console not ok 11 - /usr/home/iojs/build/workspace/node-test-linter/lib/internal/errors.js
---
message: '"ERR_INVALID_URI" is not documented in doc/api/errors.md'
severity: error
data:
line: 291
column: 1
ruleId: documented-errors
messages:
- message: doc/api/errors.md does not have an anchor for "ERR_INVALID_URI"
severity: error
data:
line: 291
column: 1
ruleId: documented-errors
...
@benhalverson Do you have time to document this error code? If not I can do that, just don't want to delay this PR for too long. |
Sorry, something went wrong.
|
@joyeecheung that error code is not present in readable. I think this should land asap before 9. |
Sorry, something went wrong.
|
@mcollina Oh, I think I posted in the wrong thread, this error is from the querystring error migration PR. The errors for this one is not ok 11 - /usr/home/iojs/build/workspace/node-test-linter/lib/internal/errors.js
---
message: >-
"ERR_STREAM_ENDREADABLE_CALLED_ON_NONEMPTY" is not documented in
doc/api/errors.md
severity: error
data:
line: 326
column: 1
ruleId: documented-errors
messages:
- message: >-
doc/api/errors.md does not have an anchor for
"ERR_STREAM_ENDREADABLE_CALLED_ON_NONEMPTY"
severity: error
data:
line: 326
column: 1
ruleId: documented-errors
- message: '"ERR_STREAM_PUSH_AFTER_EOF" is not documented in doc/api/errors.md'
severity: error
data:
line: 328
column: 1
ruleId: documented-errors
- message: doc/api/errors.md does not have an anchor for "ERR_STREAM_PUSH_AFTER_EOF"
severity: error
data:
line: 328
column: 1
ruleId: documented-errors
- message: '"ERR_STREAM_READ_NOT_IMPLEMENTED" is not documented in doc/api/errors.md'
severity: error
data:
line: 329
column: 1
ruleId: documented-errors
- message: >-
doc/api/errors.md does not have an anchor for
"ERR_STREAM_READ_NOT_IMPLEMENTED"
severity: error
data:
line: 329
column: 1
ruleId: documented-errors
- message: >-
"ERR_STREAM_UNSHIFT_AFTER_END_EVENT" is not documented in
doc/api/errors.md
severity: error
data:
line: 330
column: 1
ruleId: documented-errors
- message: >-
doc/api/errors.md does not have an anchor for
"ERR_STREAM_UNSHIFT_AFTER_END_EVENT"
severity: error
data:
line: 330
column: 1
ruleId: documented-errors
...
Also there are some incorrect use of common.expectsError, I will fix those as well. |
Sorry, something went wrong.
|
I have fixed the errors and added documentation. New CI: https://ci.nodejs.org/job/node-test-pull-request/11044/ @jasnell @BridgeAR @mcollina @addaleax @gireeshpunathil @mhdawson PTAL |
Sorry, something went wrong.
There was a problem hiding this comment.
FWIW
Sorry, something went wrong.
|
(CI failures are unrelated build issues.) |
Sorry, something went wrong.
PR-URL: #15042 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: nodejs/node#15042 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: nodejs/node#15042 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
| Back | FazBrowse Home | New Git URL |
Ref #11273
Affected core subsystem(s)
_stream_readable