test: fix race in test-http2-origin
#27861 has uncovered another race in test-http2-origin
. If origin
fires too soon, the session will be closed while the request is in progress:
Error [ERR_HTTP2_STREAM_ERROR]: Stream closed with error code NGHTTP2_REFUSED_STREAM
at ClientHttp2Stream._destroy (internal/http2/core.js:1974:13)
at ClientHttp2Stream.destroy (internal/streams/destroy.js:37:8)
at ClientHttp2Stream.[kMaybeDestroy] (internal/http2/core.js:1990:12)
at Http2Stream.onStreamClose (internal/http2/core.js:391:26)
Emitted 'error' event at:
at emitErrorNT (internal/streams/destroy.js:91:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
at processTicksAndRejections (internal/process/task_queues.js:77:11)
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows commit guidelines