Skip to content

Some readability nits, I didn't get a chance to comment#3099

Merged
knative-prow-robot merged 3 commits intoknative:masterfrom
vagababov:review-nits
Feb 5, 2019
Merged

Some readability nits, I didn't get a chance to comment#3099
knative-prow-robot merged 3 commits intoknative:masterfrom
vagababov:review-nits

Conversation

@vagababov
Copy link
Copy Markdown
Contributor

/lint

Proposed Changes

  • tests do "got... want", rather than vice versa
  • reduce scope of some variables
  • make sure err != nil, before calling err.Error(), otherwise a panic might ensue.
  • other minor stuff.

/cc @dgerd @vvraskin

@knative-prow-robot knative-prow-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Feb 5, 2019
Copy link
Copy Markdown
Contributor

@knative-prow-robot knative-prow-robot left a comment

Choose a reason for hiding this comment

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

@vagababov: 0 warnings.

Details

In response to this:

/lint

Proposed Changes

  • tests do "got... want", rather than vice versa
  • reduce scope of some variables
  • make sure err != nil, before calling err.Error(), otherwise a panic might ensue.
  • other minor stuff.

/cc @dgerd @vvraskin

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@knative-prow-robot knative-prow-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 5, 2019
@vagababov
Copy link
Copy Markdown
Contributor Author

Raised test coverage, since the main OverloadError case was not covered.

@vagababov
Copy link
Copy Markdown
Contributor Author

/test pull-knative-serving-go-coverage
/test pull-knative-serving-integration-tests

@knative-metrics-robot
Copy link
Copy Markdown

The following is the coverage report on pkg/.
Say /test pull-knative-serving-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/activator/throttler.go 86.9% 91.7% 4.8

Comment thread pkg/activator/throttler_test.go Outdated
Comment thread pkg/activator/throttler_test.go Outdated
Comment thread pkg/activator/throttler_test.go Outdated
maxConcurrency int32, revisionGetter func(RevisionID) (*v1alpha12.Revision, error),
endpointsGetter func(RevisionID) (int32, error), logger *zap.SugaredLogger,
initCapacity int32) *Throttler {
params := queue.BreakerParams{QueueDepth: 1, MaxConcurrency: maxConcurrency, InitialCapacity: initCapacity}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why the queueDepth change in the params? Should getThrottler just take this as a parameter?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The current tests do not call for the depth of more than 1.
And the parameter list is already incessantly long.
Given these two observations I opted to just change the constant.

@dgerd
Copy link
Copy Markdown

dgerd commented Feb 5, 2019

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 5, 2019
@mattmoor
Copy link
Copy Markdown
Member

mattmoor commented Feb 5, 2019

/approve

@knative-prow-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mattmoor, vagababov

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 5, 2019
@knative-prow-robot knative-prow-robot merged commit 8cdc21d into knative:master Feb 5, 2019
ZhiminXiang pushed a commit to ZhiminXiang/serving-1 that referenced this pull request Feb 7, 2019
* Some readability nits, I didn't get a chance to comment

* Raise the test coverage

* review issues addressed
@vagababov vagababov deleted the review-nits branch February 13, 2019 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants