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: stream._writableState.ending #8707

Closed
wants to merge 2 commits into from
Closed

test: stream._writableState.ending #8707

wants to merge 2 commits into from

Conversation

italoacasas
Copy link
Contributor

@italoacasas italoacasas commented Sep 22, 2016

Checklist
  • make -j4 test (UNIX), or vcbuild test nosign (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)
  • test
Description of change
  • Adding tests for stream._writableState.ending
  • Adding comment about needDrain flag

Issue related: #8686

@nodejs-github-bot nodejs-github-bot added the stream Issues and PRs related to the stream subsystem. label Sep 22, 2016
@mscdex mscdex added the test Issues and PRs related to the tests. label Sep 22, 2016
@mcollina mcollina self-assigned this Sep 26, 2016
@mcollina
Copy link
Member

mcollina commented Sep 29, 2016

Edit: Not LGTM yet.

Can you please adjust the commit message?

We need to account for this behavior here: mainly we need to check that ending might be true while the other state variables (ended, finished) are false.
https://github.com/nodejs/node/blob/master/lib/_stream_writable.js#L496-L507

@italoacasas
Copy link
Contributor Author

italoacasas commented Oct 2, 2016

@mcollina I made some changes in the test, but It was not possible for me to test the fallowing behavior.

  • ending = true while ended = false

The way that functionality is implemented right now is hard to test because they change to true at the "same time" endWritable.

This is my first time reading the stream codebase and maybe I'm not seeing something.

@mcollina
Copy link
Member

mcollina commented Oct 2, 2016

@italoacasas you will need to listen to the 'finish' event, which will be emitted in https://github.com/nodejs/node/blob/master/lib/_stream_writable.js#L488 if there are no writes in flight (for which the callback has not be called yet).

@rvagg rvagg force-pushed the master branch 2 times, most recently from c133999 to 83c7a88 Compare October 18, 2016 17:02
@italoacasas
Copy link
Contributor Author

@mcollina ping

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mcollina
Copy link
Member

mcollina commented Oct 26, 2016

@mcollina
Copy link
Member

Failures unrelated. This is good to go, I'm planning on merging tomorrow or Friday, if no one else has objections.

@cjihrig
Copy link
Contributor

cjihrig commented Oct 26, 2016

Could you capitalize and punctuate the comments in this PR. You also have some typos: 'endeding' should be 'ending' in a few places I think. Other than that LGTM.

@mcollina
Copy link
Member

mcollina commented Oct 28, 2016

Merged in fd16eed.

@mcollina mcollina closed this Oct 28, 2016
mcollina pushed a commit that referenced this pull request Oct 28, 2016
Add a test for _writableState.ending, when ending becomes true,
but the stream is not finished/ended yet.

PR-URL: #8707
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Related: #8686
@gibfahn
Copy link
Member

gibfahn commented Oct 28, 2016

@mcollina Looks like this test is causing a linter error:

/Users/gib/wrk/com/DANGER/node/test/parallel/test-stream-writableState-ending.js
  3:7  error  'common' is assigned a value but never used  no-unused-vars

Fix: #9335

evanlucas pushed a commit that referenced this pull request Nov 3, 2016
Add a test for _writableState.ending, when ending becomes true,
but the stream is not finished/ended yet.

PR-URL: #8707
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Related: #8686
MylesBorins pushed a commit that referenced this pull request Nov 17, 2016
Add a test for _writableState.ending, when ending becomes true,
but the stream is not finished/ended yet.

PR-URL: #8707
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Related: #8686
MylesBorins pushed a commit that referenced this pull request Nov 17, 2016
Add a test for _writableState.ending, when ending becomes true,
but the stream is not finished/ended yet.

PR-URL: #8707
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Related: #8686
MylesBorins pushed a commit that referenced this pull request Nov 19, 2016
Add a test for _writableState.ending, when ending becomes true,
but the stream is not finished/ended yet.

PR-URL: #8707
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Related: #8686
This was referenced Nov 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stream Issues and PRs related to the stream subsystem. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants