Skip to content

Commit

Permalink
test: make test-tls-invoke-queued use public API
Browse files Browse the repository at this point in the history
`parallel/test-tls-invoke-queued` previously used the internal
`_write()` API to hook into the internals more directly, but this
invalidates the general assumption made by streams APIs that
only a single write is active at a time, and which is enforced
through the public API.

PR-URL: #17864
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Weijia Wang <starkwang@126.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
addaleax authored and gibfahn committed Jan 24, 2018
1 parent aa65ac2 commit 8969a39
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/parallel/test-tls-invoke-queued.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ const server = tls.createServer({
key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`),
cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`)
}, common.mustCall(function(c) {
c._write('hello ', null, common.mustCall(function() {
c._write('world!', null, common.mustCall(function() {
c.write('hello ', null, common.mustCall(function() {
c.write('world!', null, common.mustCall(function() {
c.destroy();
}));
// Data on next _write() will be written but callback will not be invoked
c._write(' gosh', null, common.mustNotCall());
c.write(' gosh', null, common.mustNotCall());
}));

server.close();
Expand Down

0 comments on commit 8969a39

Please sign in to comment.