Skip to content

Commit

Permalink
[WebTransport] Fix the test for aborting close operation (#31146)
Browse files Browse the repository at this point in the history
  • Loading branch information
yutakahirano authored Oct 8, 2021
1 parent dba43ba commit 3ee661f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions webtransport/streams-close.https.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,17 @@ promise_test(async t => {
const WT_CODE = 134;
const HTTP_CODE = webtransport_code_to_http_code(WT_CODE);

// We use a large chunk so that sending the FIN signal takes time.
const chunk = new Uint8Array(64 * 1024);
const e = new WebTransportError({streamErrorCode: WT_CODE});
// Write a chunk, close the stream, and then abort the stream immediately to
// abort the closing operation.
writer.write(new Uint8Array([32]));
writer.close();
await writer.abort(
new WebTransportError({streamErrorCode: WT_CODE}));
await writer.write(chunk);
const close_promise = writer.close();
await writer.abort(e);

await promise_rejects_exactly(t, e, close_promise, 'close_promise');
await promise_rejects_exactly(t, e, writer.closed, '.closed');
writer.releaseLock();

await wait(10);
Expand Down

0 comments on commit 3ee661f

Please sign in to comment.