mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
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: https://github.com/nodejs/node/pull/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>
This commit is contained in:
1 parent
1f5975ef50
commit
a110cac4f3
1 file changed
+3
-1
@@ -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');
|
||||
|
||||
|
||||
Reference in new issue
Block a user