From 4f32e6e87806f11464f6f48da782e6b1ad709469 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Wed, 12 Feb 2020 11:36:59 -0800 Subject: [PATCH] quic: temporary fixup for test --- .../test-quic-quicstream-close-early.js | 28 ++++++++----------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/test/parallel/test-quic-quicstream-close-early.js b/test/parallel/test-quic-quicstream-close-early.js index aaacd75435..358e8705e4 100644 --- a/test/parallel/test-quic-quicstream-close-early.js +++ b/test/parallel/test-quic-quicstream-close-early.js @@ -41,25 +41,19 @@ server.on('session', common.mustCall((session) => { session.on('secure', common.mustCall((servername, alpn, cipher) => { const uni = session.openStream({ halfOpen: true }); - // TODO(@jasnell): There's still a bug in here somewhere. If we - // comment out the following line and close without writing - // anything, the test hangs. - uni.write('hi', common.mustCall()); - uni.close(3); + uni.write('hi', common.expectsError()); - uni.on('data', common.mustNotCall()); + uni.close(3); - uni.on('end', common.mustCall(() => { - debug('Undirectional, Server-initiated stream %d ended on server', - uni.id); + uni.on('error', common.mustCall(() => { + assert.strictEqual(uni.aborted, true); })); + + uni.on('data', common.mustNotCall()); uni.on('close', common.mustCall(() => { debug('Unidirectional, Server-initiated stream %d closed on server', uni.id); })); - uni.on('error', common.mustCall(() => { - assert.strictEqual(uni.aborted, true); - })); debug('Unidirectional, Server-initiated stream %d opened', uni.id); })); @@ -86,18 +80,18 @@ server.on('ready', common.mustCall(() => { const stream = req.openStream(); - stream.write('hello', common.mustCall()); - stream.close(1); + stream.write('hello', common.expectsError()); + stream.write('there', common.expectsError()); - stream.on('end', common.mustNotCall()); + stream.close(1); stream.on('error', common.mustCall(() => { assert.strictEqual(stream.aborted, true); })); + stream.on('end', common.mustNotCall()); + stream.on('close', common.mustCall(() => { - debug('Bidirectional, Client-initiated stream %d closed on client', - stream.id); countdown.dec(); }));