Skip to content

Harden stream processing close test#4263

Merged
devinivy merged 1 commit into
hapijs:masterfrom
kanongil:stream-processing-test
Jun 23, 2021
Merged

Harden stream processing close test#4263
devinivy merged 1 commit into
hapijs:masterfrom
kanongil:stream-processing-test

Conversation

@kanongil

Copy link
Copy Markdown
Contributor

I fixed the test to be compatible with node 16, which allows the req to be closed while the connection itself is still active.

I also revised the stream, so we can really validate that the processing is stopped.

This is in response to #4262 (comment).

@devinivy devinivy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That feels much better.

One thing I want to gut-check with you: do you believe that this test simulated bad/unexpected behavior from node's http server, and in turn it's not something critical to cover in node v14 and below? I see that this test has existed since the very early days of the framework, so perhaps it was more important when node was less stable/mature.

@kanongil

Copy link
Copy Markdown
Contributor Author

As I see it, the test validates that streams stop being processed when a request stops due to downstream / internal issues. My patch updates it so that it better does this with v16 (emitting close on req can no longer be used for this).

Seem legit, but might be tested by some other case. Removing it does not change coverage.

@devinivy devinivy added the test Test or coverage label Jun 23, 2021
@devinivy devinivy merged commit be3e3a2 into hapijs:master Jun 23, 2021
@kanongil kanongil deleted the stream-processing-test branch October 4, 2021 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test Test or coverage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants