★ wanayoo — archive 1999 https://github.com/nodejs/node/pull/24087Nouvelle recherche | Portail wanayoo
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: add test for socket.end callback #24087

Closed
wants to merge 2 commits into from

Conversation

Projects
None yet
6 participants
@Ajido
Copy link
Contributor

Ajido commented Nov 4, 2018

This test checks the callback of socket.end is called.

Refs: #23937

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

This comment has been minimized.

@lpinca

lpinca approved these changes Nov 5, 2018

@lpinca

This comment has been minimized.

Copy link
Member

lpinca commented Nov 5, 2018 •

LGTM but maybe it's redundant because it's probably already covered by stream.Writable#end() tests and/or other tests. It doesn't harm though.

@Ajido

This comment has been minimized.

Copy link
Contributor Author

Ajido commented Nov 6, 2018

@lpinca Thank you for your review. You're right. This test is the same as below
https://github.com/nodejs/node/blob/master/test/parallel/test-stream2-writable.js

However, I think this test will ensure that net.Socket#end() provides the same interface as stream.Writable#end().

@Ajido

This comment has been minimized.

Copy link
Contributor Author

Ajido commented Nov 6, 2018

@lpinca By the way I looked at #19241 and just realized the need to consume socket data.
I think to add the below sentence to the net's document, what do you think?

https://nodejs.org/api/http.html#http_class_http_clientrequest

calling the .resume () method. Until the data is consumed, the 'end' event will not fire.

@lpinca

This comment has been minimized.

Copy link
Member

lpinca commented Nov 6, 2018

@Ajido that's how stream.Readable works. I think it's already documented in the stream docs. If not, then it makes sense to document it.

@Ajido

This comment has been minimized.

Copy link
Contributor Author

Ajido commented Nov 6, 2018

@lpinca Gotcha. Certainly it was explained already in stream.Readable doc, and it was already linked from net.Socket.
https://nodejs.org/api/stream.html#stream_event_end

@Ajido

This comment has been minimized.

Copy link
Contributor Author

Ajido commented Nov 7, 2018

Anyone else's approval?

@Ajido

This comment has been minimized.

Copy link
Contributor Author

Ajido commented Nov 12, 2018

@jasnell Thanks! CI jobs has failed in step not related to this PR. Can you please run CI again?
https://ci.nodejs.org/job/node-test-commit-arm/19690/nodes=debian8-docker-armv7/console

13:20:55 [debian8-docker-armv7] $ /bin/sh -xe /tmp/jenkins86729623692048483.sh
13:20:55 + set -x
13:20:55 + mkdir out/junit
13:20:55 mkdir: cannot create directory ‘out/junit’: No such file or directory
13:20:56 POST BUILD TASK : FAILURE
13:20:56 END OF POST BUILD TASK : 0
13:20:56 Recording test results
13:20:56 ERROR: Step ‘Publish JUnit test result report’ failed: No test report files were found. Configuration error?
@Trott

This comment has been minimized.

@Trott Trott added the author ready label Nov 25, 2018

@Trott

This comment has been minimized.

Copy link
Member

Trott commented Nov 28, 2018

@Trott

This comment has been minimized.

Copy link
Member

Trott commented Nov 28, 2018

Landed in 628f955

@Trott Trott closed this Nov 28, 2018

Trott added a commit to Trott/io.js that referenced this pull request Nov 28, 2018

test: add test for socket.end callback
PR-URL: nodejs#24087
Refs: nodejs#23937
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@Ajido

This comment has been minimized.

Copy link
Contributor Author

Ajido commented Nov 28, 2018

@Trott Many thanks! 😄

targos added a commit that referenced this pull request Nov 28, 2018

test: add test for socket.end callback
PR-URL: #24087
Refs: #23937
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

@BridgeAR BridgeAR referenced this pull request Dec 5, 2018

Merged

v11.4.0 proposal #24854

4 of 4 tasks complete

refack added a commit to refack/node that referenced this pull request Jan 14, 2019

test: add test for socket.end callback
PR-URL: nodejs#24087
Refs: nodejs#23937
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

BethGriggs added a commit that referenced this pull request Feb 12, 2019

test: add test for socket.end callback
PR-URL: #24087
Refs: #23937
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

@BethGriggs BethGriggs referenced this pull request Feb 12, 2019

Merged

v10.15.3 proposal #26063

rvagg added a commit that referenced this pull request Feb 28, 2019

test: add test for socket.end callback
PR-URL: #24087
Refs: #23937
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.