From 8c1f41fc111db0a0fd2338cb0075b3faaafe2e66 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Mon, 25 Dec 2017 21:38:10 +0100 Subject: [PATCH] test: make test-tls-invoke-queued use public API `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: https://github.com/nodejs/node/pull/17864 Reviewed-By: Colin Ihrig Reviewed-By: Weijia Wang Reviewed-By: Daniel Bevenius Reviewed-By: James M Snell --- test/parallel/test-tls-invoke-queued.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/parallel/test-tls-invoke-queued.js b/test/parallel/test-tls-invoke-queued.js index 3d4cb8b00f3af0..159d436e81f7fa 100644 --- a/test/parallel/test-tls-invoke-queued.js +++ b/test/parallel/test-tls-invoke-queued.js @@ -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();