Skip to content

Commit

Permalink
todo
Browse files Browse the repository at this point in the history
  • Loading branch information
cirospaciari committed Oct 15, 2024
1 parent 3d7a73e commit 11a1a68
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const http2 = require("http2");
const fs = require("fs");
const path = require("path");
const os = require("os");
const { isWindows } = require("harness");

const fixtures = path.join(__dirname, "..", "fixtures");
const tmpdir = os.tmpdir();
Expand All @@ -28,7 +29,7 @@ afterAll(async () => {
if (client) client.close();
});

test("HTTP/2 server request pipe", done => {
test.todoIf(isWindows)("HTTP/2 server request pipe", done => {
const loc = path.join(fixtures, "person-large.jpg");
const fn = path.join(tmpdir, "http2-url-tests.js");

Expand Down
34 changes: 19 additions & 15 deletions test/js/node/test/parallel/http2-large-write-close.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const fixtures = require("../common/fixtures");
const http2 = require("http2");

const { beforeEach, afterEach, test, expect } = require("bun:test");

const { isWindows } = require("harness");
const content = Buffer.alloc(1e5, 0x44);

let server;
Expand Down Expand Up @@ -45,22 +45,26 @@ afterEach(() => {
server.close();
});

test("HTTP/2 large write and close", done => {
const client = http2.connect(`https://localhost:${port}`, { rejectUnauthorized: false });
test.todoIf(isWindows)(
"HTTP/2 large write and close",
done => {
const client = http2.connect(`https://localhost:${port}`, { rejectUnauthorized: false });

const req = client.request({ ":path": "/" });
req.end();
const req = client.request({ ":path": "/" });
req.end();

let receivedBufferLength = 0;
req.on("data", buf => {
receivedBufferLength += buf.byteLength;
});
let receivedBufferLength = 0;
req.on("data", buf => {
receivedBufferLength += buf.byteLength;
});

req.on("close", () => {
expect(receivedBufferLength).toBe(content.byteLength * 2);
client.close();
done();
});
}, 5000);
req.on("close", () => {
expect(receivedBufferLength).toBe(content.byteLength * 2);
client.close();
done();
});
},
5000,
);

//<#END_FILE: test-http2-large-write-close.js

0 comments on commit 11a1a68

Please sign in to comment.