test: deflake test-http2-options-max-headers-block-length

The socket can be closed while data is still being written, causing an
`ECONNRESET` error to be emitted on the client. Add a listener for it.

PR-URL: https://github.com/nodejs/node/pull/57959
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
This commit is contained in:
Luigi Pinca 2025-04-24 07:08:08 +02:00 committed by GitHub
parent bd3f27166b
commit 555aeb3aae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -22,6 +22,8 @@ server.listen(0, common.mustCall(() => {
const client = h2.connect(`http://localhost:${server.address().port}`,
options);
client.on('error', () => {});
const req = client.request();
req.on('response', common.mustNotCall());