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 RafaelGSS committed Nov 10, 2022
1 parent d9163f1 commit ddb7df7
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
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 ddb7df7

Please sign in to comment.