Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset metric observed by TestProxyHandler for repeatable test runs. #107060

Merged
merged 1 commit into from
Dec 16, 2021

Conversation

benluddy
Copy link
Contributor

This test expects x509_missing_san_total to be 1. When run with
-test.count greater than 1, that expectation is unmet for all but the
first test run.

What type of PR is this?

/kind bug
/kind failing-test

What this PR does / why we need it:

Fixes TestProxyHandler, which depends on the value of a global counter, when tests are executed with -test.count greater than 1.

Which issue(s) this PR fixes:

Fixes #107059

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

This test expects x509_missing_san_total to be 1. When run with
-test.count greater than 1, that expectation is unmet for all but the
first test run.
@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. kind/failing-test Categorizes issue or PR as related to a consistently or frequently failing test. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 15, 2021
@k8s-ci-robot
Copy link
Contributor

Hi @benluddy. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added the needs-priority Indicates a PR lacks a `priority/foo` label and requires one. label Dec 15, 2021
@k8s-ci-robot k8s-ci-robot added sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Dec 15, 2021
@aojea
Copy link
Member

aojea commented Dec 15, 2021

/ok-to-test
/lgtm

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 15, 2021
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 15, 2021
@aojea
Copy link
Member

aojea commented Dec 15, 2021

go test -v k8s.io/kube-aggregator/pkg/apiserver -run TestProxyHandler -count 2
=== RUN   TestProxyHandler
E1215 23:28:54.849364   67930 handler_proxy.go:148] error resolving test-ns/bad-service: unresolveable
2021/12/15 23:28:54 http: TLS handshake error from 127.0.0.1:37388: remote error: tls: bad certificate
2021/12/15 23:28:54 http: TLS handshake error from 127.0.0.1:46674: remote error: tls: bad certificate
--- PASS: TestProxyHandler (0.02s)
=== RUN   TestProxyHandler
E1215 23:28:54.874326   67930 handler_proxy.go:148] error resolving test-ns/bad-service: unresolveable
2021/12/15 23:28:54 http: TLS handshake error from 127.0.0.1:49672: remote error: tls: bad certificate
2021/12/15 23:28:54 http: TLS handshake error from 127.0.0.1:46572: remote error: tls: bad certificate
    handler_proxy_test.go:380: expected the x509_missing_san_total to be 1, but it's 2
--- FAIL: TestProxyHandler (0.01s)
FAIL
FAIL	k8s.io/kube-aggregator/pkg/apiserver	0.059s
FAIL

with this PR

$ go test -v k8s.io/kube-aggregator/pkg/apiserver -run TestProxyHandler -count 2
=== RUN   TestProxyHandler
E1215 23:29:26.432457   73064 handler_proxy.go:148] error resolving test-ns/bad-service: unresolveable
2021/12/15 23:29:26 http: TLS handshake error from 127.0.0.1:50898: remote error: tls: bad certificate
2021/12/15 23:29:26 http: TLS handshake error from 127.0.0.1:52016: remote error: tls: bad certificate
--- PASS: TestProxyHandler (0.03s)
=== RUN   TestProxyHandler
2021/12/15 23:29:26 http: TLS handshake error from 127.0.0.1:40362: remote error: tls: bad certificate
2021/12/15 23:29:26 http: TLS handshake error from 127.0.0.1:52050: remote error: tls: bad certificate
E1215 23:29:26.482886   73064 handler_proxy.go:148] error resolving test-ns/bad-service: unresolveable
--- PASS: TestProxyHandler (0.02s)
PASS
ok  	k8s.io/kube-aggregator/pkg/apiserver	0.078s

@benluddy
Copy link
Contributor Author

/retest

@fedebongio
Copy link
Contributor

/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Dec 16, 2021
@aojea
Copy link
Member

aojea commented Dec 16, 2021

@liggitt for approval

@liggitt
Copy link
Member

liggitt commented Dec 16, 2021

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: benluddy, liggitt

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

The pull request process is described here

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 16, 2021
@k8s-ci-robot k8s-ci-robot merged commit 00bbea4 into kubernetes:master Dec 16, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.24 milestone Dec 16, 2021
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. kind/failing-test Categorizes issue or PR as related to a consistently or frequently failing test. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesn't merit a release note. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TestProxyHandler fails with test.count greater than 1
5 participants