Skip to content

Commit

Permalink
test: deflake test-http2-empty-frame-without-eof
Browse files Browse the repository at this point in the history
It may happen that the data in `emptyframe.http2` reaches the client
even before the client has started sending the request, causing an
`ERR_HTTP2_STREAM_ERROR` instead. Fix this by making sure the frame is
not sent until some data reaches the server.

PR-URL: #45212
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
  • Loading branch information
santigimeno authored and danielleadams committed Jan 3, 2023
1 parent 1f5975e commit a110cac
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/parallel/test-http2-empty-frame-without-eof.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ const { once } = require('events');
async function main() {
const blobWithEmptyFrame = readSync('emptyframe.http2');
const server = net.createServer((socket) => {
socket.end(blobWithEmptyFrame);
socket.once('data', () => {
socket.end(blobWithEmptyFrame);
});
}).listen(0);
await once(server, 'listening');

Expand Down

0 comments on commit a110cac

Please sign in to comment.