-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Fix flaky dns test #6923
Fix flaky dns test #6923
Conversation
go server.ListenAndServe() | ||
|
||
go func() { | ||
if err := server.ListenAndServe(); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated change: don't silently fail ListenAndServe, fail test instead.
/cherrypick release-1.12 |
@inteon: once the present PR merges, I will cherry-pick it on top of release-1.12 in a new PR and assign it to you. In response to this:
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. |
/cherrypick release-1.13 |
@inteon: once the present PR merges, I will cherry-pick it on top of release-1.13 in a new PR and assign it to you. In response to this:
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. |
/cherrypick release-1.14 |
@inteon: once the present PR merges, I will cherry-pick it on top of release-1.14 in a new PR and assign it to you. In response to this:
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain how using our own Mux fixes things compared to the DefaultServeMux?
…equests Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
1682d49
to
0f69abd
Compare
dnsServerCalled := int32(0) | ||
|
||
server := &dns.Server{Addr: "127.0.0.1:15353", Net: "udp"} | ||
server := &dns.Server{Addr: "127.0.0.1:15353", Net: "udp", NotifyStartedFunc: func() { close(dnsServerStarted) }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We received a read: connection refused
error when the test started before the DNS server was started.
defer server.Shutdown() | ||
|
||
dns.HandleFunc(".", func(w dns.ResponseWriter, r *dns.Msg) { | ||
mux := &dns.ServeMux{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We create a new mux here instead of using the default/ global mux, so that we cannot interfere with other mux registrations (in other tests or when running this test in parallel).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we can run in parallel since we use a fixed port for the DNS server, but I can see how we would want to reset the state between tests.
Thanks for the comment, I actually hadn't fixed the test completely yet. |
Ah, so the main fix was the new channel we wait on to ensure the DNS server is up and running. That makes sense to me. |
/retest |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: inteon 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 |
@inteon: new pull request created: #6934 In response to this:
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. |
@inteon: new pull request created: #6935 In response to this:
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. |
@inteon: new pull request created: #6936 In response to this:
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. |
Example flake: https://prow.infra.cert-manager.io/view/gs/cert-manager-prow-artifacts/logs/ci-cert-manager-master-make-test/1781654108378238976
Master:
This PR:
$ go test -count=100 -timeout 30s -run ^TestReachabilityCustomDnsServers$ github.com/cert-manager/cert-manager/pkg/issuer/acme/http ok github.com/cert-manager/cert-manager/pkg/issuer/acme/http 21.122s
Kind
/kind flake
Release Note