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

quic: fix client migration and stream reset #341

Closed
wants to merge 7 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
quic: temporary fixup for test
  • Loading branch information
jasnell committed Feb 12, 2020
commit 9496bc8a4159e8881e9c4d83edcf5e551273fb06
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