Skip to content

Commit a110cac

Browse files
santigimenodanielleadams
authored andcommitted
test: deflake test-http2-empty-frame-without-eof
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>
1 parent 1f5975e commit a110cac

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/parallel/test-http2-empty-frame-without-eof.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ const { once } = require('events');
1010
async function main() {
1111
const blobWithEmptyFrame = readSync('emptyframe.http2');
1212
const server = net.createServer((socket) => {
13-
socket.end(blobWithEmptyFrame);
13+
socket.once('data', () => {
14+
socket.end(blobWithEmptyFrame);
15+
});
1416
}).listen(0);
1517
await once(server, 'listening');
1618

0 commit comments

Comments
 (0)