Add unit tests for activator#1585
Conversation
Refactored retryRoundTripper and activationHandler into multiple components to make testing simpler. Fixes #1231
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: tanzeeb If they are not already assigned, you can assign the PR to them by writing The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/hold Wait until after we cut first release. |
|
/hold cancel |
|
/assign @josephburnett |
| @@ -0,0 +1,103 @@ | |||
| /* | |||
| Copyright 2018 The Knative Authors | |||
There was a problem hiding this comment.
@tanzeeb - I didn't see this PR before and I was doing the exact same work on my side - Luckily I was half complete.
Can you take a look at my own version of round tripper refactoring here:
https://github.com/mdemirhan/serving/blob/activatortraces/pkg/activator/httptransport.go
https://github.com/mdemirhan/serving/blob/activatortraces/pkg/activator/httptransport_test.go
I have a biased preference towards using the implementation above for a couple of reasons :-)
- It instantiates the transport for HTTP2 only once and keeps reusing it. Creating an HTTP2 transport for every transaction is unnecessary
- It implements the RoundTripper interface on the pointer rather than the value preventing extra memory copies.
Please take a look and if it looks good, feel free to copy it over this one as part of your PR. I will wait for your changes to get in before I add tracing features to activator.
Let me know what you think.
There was a problem hiding this comment.
@mdemirhan I've posted updates in #1689 , please let me know what you think.
|
Continuing this PR on #1689, since the original fork is a closed source repo. |
Refactored retryRoundTripper and activationHandler into multiple
components to make testing simpler.
Fixes #1231