test: deflake test-http2-client-socket-destroy

The socket can be destroyed by the other peer while data is still being
written. Add a listener for the `'error'` event.

PR-URL: https://github.com/nodejs/node/pull/58212
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
This commit is contained in:
Luigi Pinca 2025-05-09 21:14:23 +02:00 committed by GitHub
parent 264cad75ce
commit 508cd0f275
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -15,6 +15,7 @@ const server = h2.createServer();
// We use the lower-level API here
server.on('stream', common.mustCall((stream) => {
stream.on('error', () => {});
stream.on('aborted', common.mustCall());
stream.on('close', common.mustCall());
stream.respond();