-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
✨ (go/v4) Add Metrics Validation and Helper Functions to E2E Tests #4131
Conversation
|
Hi @mogsie. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the 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-sigs/prow repository. |
e9227fb
to
1151a1a
Compare
afc7d77
to
6b67366
Compare
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.
Hi @mogsie
That is great !!! Well done 🎉
Just a couple of nits:
- Can you please squash all commits? We need to have 1 commit per PR before merge
- 2 see that to update all samples and docs we need to run
make install and then, make generate
. In this way, all will be re-scaffolded - For all eventually checks, could we run the check after each 10 seconds? So that we avoid see so many lines in the log trying to retrieve the staff?
So, can you please do both for we get this one merged (assuming that will pass in the tests CI)
} | ||
// Repeatedly check if the controller-manager pod is running until it succeeds or times out. | ||
EventuallyWithOffset(1, verifyControllerUp, time.Minute, time.Second).Should(Succeed()) | ||
Eventually(verifyControllerUp, time.Minute, time.Second).Should(Succeed()) |
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.
Eventually(verifyControllerUp, time.Minute, time.Second).Should(Succeed()) | |
Eventually(verifyControllerUp, time.Minute, 10* time.Second).Should(Succeed()) |
Could we test each 10 seconds?
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.
Oh, my bad, I botched this syntax. It should have been
Eventually(verifyControllerUp, time.Minute, time.Second).Should(Succeed()) | |
Eventually(verifyControllerUp).WithTimeout(time.Minute).WithInterval(time.Second).Should(Succeed()) |
The default interval is 100ms, I think, so that's why the log was filled with these.
I think I can configure the timeout and intervals at the top of the test instead. No need to litter the code with this.
g.Expect(string(logs)).To(ContainSubstring("controller-runtime.metrics\tServing metrics server"), | ||
"Metrics server not yet started") | ||
} | ||
Eventually(verifyMetricsServerStarted).WithTimeout(2 * time.Minute).Should(Succeed()) |
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.
Eventually(verifyMetricsServerStarted).WithTimeout(2 * time.Minute).Should(Succeed()) | |
Eventually(verifyMetricsServerStarted).WithTimeout(2 * time.Minute, 10 * time.Seconds).Should(Succeed()) |
Eventually(verifyMetricsServerStarted).WithTimeout(2 * time.Minute).Should(Succeed()) | |
Eventually(verifyControllerUp, time.Minute, 10* time.Second).Should(Succeed()) |
Could we test each after 10 seconds?
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 added a default interval of 1 second and timeout of 2 minutes, so I could remove most of the WithTimeout calls. hopefully the logs won't contain more than a few lines of repeated log entries when Eventuallying.
"-n", namespace) | ||
g.Expect(utils.Run(cmd)).To(BeEquivalentTo("Succeeded"), "curl pod in wrong status") | ||
} | ||
Eventually(verifyCurlUp).WithTimeout(5 * time.Minute).Should(Succeed()) |
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.
same here:
Could we test each after 10 seconds?
I only really concentrated on the first test; I wanted to know if I was overreaching or if this was going in the right direction. I will extend the change to the whole file later. 👍 |
I based my PR off your work; I could rebase this off #4124, if you prefer (to keep things separate). Edit Oh, I see you prefer this PR to 4124. I'll just squash it all then, when I continue. |
Yes, just squash all. |
Provide further improvements for e2e tests test to help users be aware of how to tests using the metrics endpoint and validate if the metrics are properly expose.
6b67366
to
d279035
Compare
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.
/lgtm
/ok-to-test
/approved
Great work !!!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: camilamacedo86, mogsie 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 |
Provide further improvements for e2e tests test to help users be aware of how to tests using the metrics endpoint and validate if the metrics are properly expose. Furthermore, shows how to use it to validate the reconciliation.
Closes: #4124
Partially closes: #4120