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
Closed

Conversation

Ajido
Copy link
Contributor

@Ajido 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

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Nov 4, 2018
@Trott
Copy link
Member

Trott commented Nov 5, 2018

@lpinca
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
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
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
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
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
Copy link
Contributor Author

Ajido commented Nov 7, 2018

Anyone else's approval?

@Ajido
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
Copy link
Member

Trott commented Nov 25, 2018

@Trott Trott added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Nov 25, 2018
@Trott
Copy link
Member

Trott commented Nov 28, 2018

@Trott
Copy link
Member

Trott commented Nov 28, 2018

Landed in 628f955

@Trott Trott closed this Nov 28, 2018
Trott pushed a commit to Trott/io.js that referenced this pull request Nov 28, 2018
PR-URL: nodejs#24087
Refs: nodejs#23937
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@Ajido
Copy link
Contributor Author

Ajido commented Nov 28, 2018

@Trott Many thanks! 😄

@BethGriggs BethGriggs mentioned this pull request Feb 12, 2019
rvagg pushed a commit that referenced this pull request Feb 28, 2019
PR-URL: #24087
Refs: #23937
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
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. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants