Skip to content

Conversation

brb
Copy link
Member

@brb brb commented Mar 5, 2020

Previously, WaitforPods() could prematurely return when GetPods() returned no pods (e.g. WaitforPods() had been immediately called after sending a create pods request).

To avoid this, we should wait (by returning false) when the pod list is empty instead of setting the minRequired.

This makes the function to fail when a user intentionally set minRequired to 0 in WaitforNPodsRunning(), but I don't see any sane use case where setting minRequired to 0 would make sense.

Example of such race:

time="2020-02-29T13:05:44Z" level=debug msg="applying /home/jenkins/workspace/Cilium-PR-Ginkgo-Tests-Validated/k8s-1.11-gopath/src/github.com/cilium/cilium/test/k8sT/manifests/log-gatherer.yaml in namespace kube-system"
time="2020-02-29T13:05:44Z" level=debug msg="running command: kubectl apply --force=false -f /home/jenkins/workspace/Cilium-PR-Ginkgo-Tests-Validated/k8s-1.11-gopath/src/github.com/cilium/cilium/test/k8sT/manifests/log-gatherer.yaml -n kube-system"
cmd: "kubectl apply --force=false -f /home/jenkins/workspace/Cilium-PR-Ginkgo-Tests-Validated/k8s-1.11-gopath/src/github.com/cilium/cilium/test/k8sT/manifests/log-gatherer.yaml -n kube-system" exitCode: 0 duration: 92.720906ms stdout:
serviceaccount/cilium unchanged
daemonset.apps/log-gatherer unchanged

time="2020-02-29T13:05:44Z" level=debug msg="running command: kubectl -n kube-system get pods -l k8s-app=cilium-test-logs -o json"
cmd: "kubectl -n kube-system get pods -l k8s-app=cilium-test-logs -o json" exitCode: 0 duration: 43.672802ms stdout:
{
    "apiVersion": "v1",
    "items": [],
    "kind": "List",
    "metadata": {
        "resourceVersion": "",
        "selfLink": ""
    }
}

Fix #10277.


This change is Reviewable

@brb brb added pending-review kind/bug/CI This is a bug in the testing code. area/CI Continuous Integration testing issue or flake release-note/ci This PR makes changes to the CI. labels Mar 5, 2020
@brb brb requested a review from a team as a code owner March 5, 2020 11:14
@brb
Copy link
Member Author

brb commented Mar 5, 2020

test-me-please

@brb brb force-pushed the pr/brb/ci-fix-get-iface-flake branch from 93bce16 to d4c2122 Compare March 5, 2020 12:21
@brb
Copy link
Member Author

brb commented Mar 5, 2020

test-me-please

@coveralls
Copy link

coveralls commented Mar 5, 2020

Coverage Status

Coverage increased (+0.01%) to 45.615% when pulling 44d19ed on pr/brb/ci-fix-get-iface-flake into 8ddc98e on master.

brb added 3 commits March 5, 2020 15:09
They were removed in 7b6d34d ("CI: Switch CI FQDN tests to use
internet domains").

Signed-off-by: Martynas Pumputis <m@lambda.lt>
There is no namespace "foo".

Fixes: 31d16dc ("test: add e2e test for proxy-visibility")
Signed-off-by: Martynas Pumputis <m@lambda.lt>
Previously, WaitforPods() could prematurely return when kub.GetPods()
returned no pods (e.g. WaitforPods() had been immediately called after
sending a create pods request).

To avoid this, we should wait (by returning false) when the pod list
is empty instead of setting the minRequired.

This makes the function to fail when a user intentionally set
minRequired to 0 in WaitforNPodsRunning(), but I don't see any sane use
case where setting minRequired to 0 would make sense.

Signed-off-by: Martynas Pumputis <m@lambda.lt>
@brb brb force-pushed the pr/brb/ci-fix-get-iface-flake branch from d4c2122 to 44d19ed Compare March 5, 2020 14:32
@brb
Copy link
Member Author

brb commented Mar 5, 2020

test-me-please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/CI Continuous Integration testing issue or flake kind/bug/CI This is a bug in the testing code. release-note/ci This PR makes changes to the CI.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CI: K8sPolicyTest Basic Test checks all kind of Kubernetes policies: Cilium cannot be installed: Failed to exec \"ip ...\" cmd on \"k8s1\" node
6 participants