{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/69930","repository_url":"https://api.github.com/repos/kubernetes/kubernetes","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/69930/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/69930/comments","events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/69930/events","html_url":"https://github.com/kubernetes/kubernetes/pull/69930","id":371048509,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIzNTgzNzc0","number":69930,"title":"Use apimachinery util/rand instead of math/rand","user":{"login":"ash2k","id":126021,"node_id":"MDQ6VXNlcjEyNjAyMQ==","avatar_url":"https://avatars3.githubusercontent.com/u/126021?v=4","gravatar_id":"","url":"https://api.github.com/users/ash2k","html_url":"https://github.com/ash2k","followers_url":"https://api.github.com/users/ash2k/followers","following_url":"https://api.github.com/users/ash2k/following{/other_user}","gists_url":"https://api.github.com/users/ash2k/gists{/gist_id}","starred_url":"https://api.github.com/users/ash2k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ash2k/subscriptions","organizations_url":"https://api.github.com/users/ash2k/orgs","repos_url":"https://api.github.com/users/ash2k/repos","events_url":"https://api.github.com/users/ash2k/events{/privacy}","received_events_url":"https://api.github.com/users/ash2k/received_events","type":"User","site_admin":false},"labels":[{"id":136601536,"node_id":"MDU6TGFiZWwxMzY2MDE1MzY=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/area/apiserver","name":"area/apiserver","color":"0052cc","default":false},{"id":138247961,"node_id":"MDU6TGFiZWwxMzgyNDc5NjE=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/area/kubectl","name":"area/kubectl","color":"0052cc","default":false},{"id":116719829,"node_id":"MDU6TGFiZWwxMTY3MTk4Mjk=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/area/kubelet","name":"area/kubelet","color":"0052cc","default":false},{"id":477397086,"node_id":"MDU6TGFiZWw0NzczOTcwODY=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/cncf-cla:%20yes","name":"cncf-cla: yes","color":"bfe5bf","default":false},{"id":105146071,"node_id":"MDU6TGFiZWwxMDUxNDYwNzE=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/kind/bug","name":"kind/bug","color":"e11d21","default":false},{"id":349530249,"node_id":"MDU6TGFiZWwzNDk1MzAyNDk=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/release-note-none","name":"release-note-none","color":"c2e0c6","default":false},{"id":173493835,"node_id":"MDU6TGFiZWwxNzM0OTM4MzU=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/sig/api-machinery","name":"sig/api-machinery","color":"d2b48c","default":false},{"id":404091735,"node_id":"MDU6TGFiZWw0MDQwOTE3MzU=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/sig/apps","name":"sig/apps","color":"d2b48c","default":false},{"id":636152047,"node_id":"MDU6TGFiZWw2MzYxNTIwNDc=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/sig/architecture","name":"sig/architecture","color":"d2b48c","default":false},{"id":450823910,"node_id":"MDU6TGFiZWw0NTA4MjM5MTA=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/sig/cli","name":"sig/cli","color":"d2b48c","default":false},{"id":958178286,"node_id":"MDU6TGFiZWw5NTgxNzgyODY=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/sig/cloud-provider","name":"sig/cloud-provider","color":"d2b48c","default":false},{"id":116712108,"node_id":"MDU6TGFiZWwxMTY3MTIxMDg=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/sig/network","name":"sig/network","color":"d2b48c","default":false},{"id":173493665,"node_id":"MDU6TGFiZWwxNzM0OTM2NjU=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/sig/node","name":"sig/node","color":"d2b48c","default":false},{"id":614023989,"node_id":"MDU6TGFiZWw2MTQwMjM5ODk=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/sig/release","name":"sig/release","color":"d2b48c","default":false},{"id":125550211,"node_id":"MDU6TGFiZWwxMjU1NTAyMTE=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/sig/scheduling","name":"sig/scheduling","color":"d2b48c","default":false},{"id":169428334,"node_id":"MDU6TGFiZWwxNjk0MjgzMzQ=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/sig/storage","name":"sig/storage","color":"d2b48c","default":false},{"id":483069764,"node_id":"MDU6TGFiZWw0ODMwNjk3NjQ=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/sig/testing","name":"sig/testing","color":"d2b48c","default":false},{"id":253450978,"node_id":"MDU6TGFiZWwyNTM0NTA5Nzg=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/size/L","name":"size/L","color":"ee9900","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-10-17T12:30:44Z","updated_at":"2018-10-18T10:36:33Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/69930","html_url":"https://github.com/kubernetes/kubernetes/pull/69930","diff_url":"https://github.com/kubernetes/kubernetes/pull/69930.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/69930.patch"},"body":"**What this PR does / why we need it**:\r\n`math/rand` is [initialized with seed = 1](https://github.com/golang/go/blob/release-branch.go1.11/src/math/rand/rand.go#L288). That means any code that uses `math/rand` may get a sequence of values that are not so random if the RNG is not seeded.\r\n- Kubernetes codebase seeds `math/rand` in all `main()` functions but not all `TestMain()` functions (I'll fix that in a follow up PR). So quite a few (not all) tests have the issue described above.\r\n- Bits of Kubernetes are exported into numerous repositories and are consumable as libraries. A lot of people are not aware that they need to seed the RNG in their `main()` and don't do it. How many hard to debug bugs does this cause?\r\n\r\nPackage `k8s.io/apimachinery/pkg/util/rand` [seeds the RNG with current time](https://github.com/kubernetes/kubernetes/blob/f5e9c0473c37bdef951238de63f35db5af176acd/staging/src/k8s.io/apimachinery/pkg/util/rand/rand.go#L30) when it is initialized and hence does not need any extra seeding from the user. This PR changes all `math/rand` usages in the codebase to `k8s.io/apimachinery/pkg/util/rand` to solve the issues outlined above. `math/rand` still need to be seeded because 3rd party libraries are relying on it.\r\n\r\nThis is a follow up for https://github.com/kubernetes/kubernetes/pull/69670.\r\n\r\n**Release note**:\r\n```release-note\r\nNONE\r\n```\r\n/sig api-machinery\r\n/kind bug"},"comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments/430960241","html_url":"https://github.com/kubernetes/kubernetes/pull/69930#issuecomment-430960241","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/69930","id":430960241,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMDk2MDI0MQ==","user":{"login":"k8s-ci-robot","id":20407524,"node_id":"MDQ6VXNlcjIwNDA3NTI0","avatar_url":"https://avatars0.githubusercontent.com/u/20407524?v=4","gravatar_id":"","url":"https://api.github.com/users/k8s-ci-robot","html_url":"https://github.com/k8s-ci-robot","followers_url":"https://api.github.com/users/k8s-ci-robot/followers","following_url":"https://api.github.com/users/k8s-ci-robot/following{/other_user}","gists_url":"https://api.github.com/users/k8s-ci-robot/gists{/gist_id}","starred_url":"https://api.github.com/users/k8s-ci-robot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/k8s-ci-robot/subscriptions","organizations_url":"https://api.github.com/users/k8s-ci-robot/orgs","repos_url":"https://api.github.com/users/k8s-ci-robot/repos","events_url":"https://api.github.com/users/k8s-ci-robot/events{/privacy}","received_events_url":"https://api.github.com/users/k8s-ci-robot/received_events","type":"User","site_admin":false},"created_at":"2018-10-18T10:36:33Z","updated_at":"2018-10-18T10:36:33Z","author_association":"CONTRIBUTOR","body":"@ash2k: The following tests **failed**, say `/retest` to rerun them all:\n\nTest name | Commit | Details | Rerun command\n--- | --- | --- | ---\npull-kubernetes-verify | 428d3ca562a4261c4229c49a78b043f1e35139d8 | [link](https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/pr-logs/pull/69930/pull-kubernetes-verify/110029/) | `/test pull-kubernetes-verify`\npull-kubernetes-e2e-gce-device-plugin-gpu | da62a576f16d8a720b5a6201283d8f71847cd7ce | [link](https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/pr-logs/pull/69930/pull-kubernetes-e2e-gce-device-plugin-gpu/50520/) | `/test pull-kubernetes-e2e-gce-device-plugin-gpu`\npull-kubernetes-e2e-gce | da62a576f16d8a720b5a6201283d8f71847cd7ce | [link](https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/pr-logs/pull/69930/pull-kubernetes-e2e-gce/56304/) | `/test pull-kubernetes-e2e-gce`\npull-kubernetes-bazel-build | da62a576f16d8a720b5a6201283d8f71847cd7ce | [link](https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/pr-logs/pull/69930/pull-kubernetes-bazel-build/61387/) | `/test pull-kubernetes-bazel-build`\npull-kubernetes-e2e-kops-aws | da62a576f16d8a720b5a6201283d8f71847cd7ce | [link](https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/pr-logs/pull/69930/pull-kubernetes-e2e-kops-aws/109952/) | `/test pull-kubernetes-e2e-kops-aws`\npull-kubernetes-node-e2e | da62a576f16d8a720b5a6201283d8f71847cd7ce | [link](https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/pr-logs/pull/69930/pull-kubernetes-node-e2e/107897/) | `/test pull-kubernetes-node-e2e`\npull-kubernetes-e2e-gce-100-performance | da62a576f16d8a720b5a6201283d8f71847cd7ce | [link](https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/pr-logs/pull/69930/pull-kubernetes-e2e-gce-100-performance/23419/) | `/test pull-kubernetes-e2e-gce-100-performance`\npull-kubernetes-kubemark-e2e-gce-big | da62a576f16d8a720b5a6201283d8f71847cd7ce | [link](https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/pr-logs/pull/69930/pull-kubernetes-kubemark-e2e-gce-big/25759/) | `/test pull-kubernetes-kubemark-e2e-gce-big`\npull-kubernetes-local-e2e-containerized | da62a576f16d8a720b5a6201283d8f71847cd7ce | [link](https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/pr-logs/pull/69930/pull-kubernetes-local-e2e-containerized/3073/) | `/test pull-kubernetes-local-e2e-containerized`\npull-kubernetes-local-e2e | da62a576f16d8a720b5a6201283d8f71847cd7ce | [link](https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/pr-logs/pull/69930/pull-kubernetes-local-e2e/351/) | `/test pull-kubernetes-local-e2e`\npull-kubernetes-integration | da62a576f16d8a720b5a6201283d8f71847cd7ce | [link](https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/pr-logs/pull/69930/pull-kubernetes-integration/31595/) | `/test pull-kubernetes-integration`\npull-kubernetes-bazel-test | 38d09c391759ff7fe5193b43236e56552412c5e0 | [link](https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/pr-logs/pull/69930/pull-kubernetes-bazel-test/64004/) | `/test pull-kubernetes-bazel-test`\npull-kubernetes-typecheck | 38d09c391759ff7fe5193b43236e56552412c5e0 | [link](https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/pr-logs/pull/69930/pull-kubernetes-typecheck/28234/) | `/test pull-kubernetes-typecheck`\n\n[Full PR test history](https://k8s-gubernator.appspot.com/pr/69930). [Your PR dashboard](https://k8s-gubernator.appspot.com/pr/ash2k). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes/kubernetes/issues?q=is:issue+is:open) when you hit one in your PR.\n\n<details>\n\nInstructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).\n</details>\n<!-- test report -->"}}
{"actor":{"display_login":"k8s-ci-robot"}}