test(metrics): replace random value with a static value#5462
test(metrics): replace random value with a static value#5462k8s-ci-robot merged 1 commit intokubernetes-sigs:masterfrom
Conversation
|
Hi @u-kai. 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. DetailsInstructions 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. |
|
/ok-to-test |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ivankatliarchuk, mloiseleur 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 |
What does it do ?
This PR replaces the randomly generated
Subsystemnames ininternal/gen/docs/metrics/main_test.gowith static, unique values.Previously,
rand.IntN(100)was used to reduce the chance of collision, but this still introduced a 1% chance of flaky test failures due to duplicate names.Motivation
In #5459, we discussed improving test stability by adding +100 to the second
rand.IntNcall.While that suggestion would reduce the collision probability, I opted for static values instead.
This eliminates the chance of collision entirely and ensures that if a conflicting test is added in the future, it will fail deterministically and be immediately detectable during development or CI.
More