Skip to content

Commit 8c1f41f

Browse files
addaleaxMylesBorins
authored andcommitted
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: #17864 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Weijia Wang <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 4b4e4db commit 8c1f41f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/parallel/test-tls-invoke-queued.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ const server = tls.createServer({
1414
key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`),
1515
cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`)
1616
}, common.mustCall(function(c) {
17-
c._write('hello ', null, common.mustCall(function() {
18-
c._write('world!', null, common.mustCall(function() {
17+
c.write('hello ', null, common.mustCall(function() {
18+
c.write('world!', null, common.mustCall(function() {
1919
c.destroy();
2020
}));
2121
// Data on next _write() will be written but callback will not be invoked
22-
c._write(' gosh', null, common.mustNotCall());
22+
c.write(' gosh', null, common.mustNotCall());
2323
}));
2424

2525
server.close();

0 commit comments

Comments
 (0)