Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

Commit

Permalink
quic: temporary fixup for test
Browse files Browse the repository at this point in the history
  • Loading branch information
jasnell committed Feb 12, 2020
1 parent 1c6c8a7 commit 4f32e6e
Showing 1 changed file with 11 additions and 17 deletions.
28 changes: 11 additions & 17 deletions test/parallel/test-quic-quicstream-close-early.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}));
Expand All @@ -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();
}));

Expand Down

0 comments on commit 4f32e6e

Please sign in to comment.