Skip to content
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 race condition in DynamicallyProvisionedDeletePodTest #203

Merged

Conversation

dkoshkin
Copy link
Contributor

@dkoshkin dkoshkin commented Feb 7, 2019

Test:

[ebs-csi-e2e] [single-az] Dynamic Provisioning should create a deployment object, write and read to it, delete the pod and write and read to it again

Is this a bug fix or adding new feature?
bug fix

What is this PR about? / Why do we need it?
Waif for pod to be actually deleted before checking if the replacement pod is running.

Test snipped from a failed test:

STEP: deleting the pod for deployment
Feb  7 17:46:15.467: INFO: Deleting pod "ebs-volume-tester-rp8kv-58f768d56f-fvwx5" in namespace "e2e-tests-ebs-zm5g2"
STEP: checking again that the pod is running
STEP: checking pod exec
Feb  7 17:46:15.822: INFO: Running '/usr/local/bin/kubectl --kubeconfig=/Users/dkoshkin/.kube/config exec ebs-volume-tester-rp8kv-58f768d56f-fvwx5 --namespace=e2e-tests-ebs-zm5g2 -- cat /mnt/test-1/data'
Feb  7 17:46:17.222: INFO: stderr: ""
Feb  7 17:46:17.222: INFO: stdout: "hello world\n"
Feb  7 17:46:19.226: INFO: Running '/usr/local/bin/kubectl --kubeconfig=/Users/dkoshkin/.kube/config exec ebs-volume-tester-rp8kv-58f768d56f-fvwx5 --namespace=e2e-tests-ebs-zm5g2 -- cat /mnt/test-1/data'
Feb  7 17:46:20.599: INFO: stderr: ""
Feb  7 17:46:20.600: INFO: stdout: "hello world\n"
Feb  7 17:46:22.603: INFO: Running '/usr/local/bin/kubectl --kubeconfig=/Users/dkoshkin/.kube/config exec ebs-volume-tester-rp8kv-58f768d56f-fvwx5 --namespace=e2e-tests-ebs-zm5g2 -- cat /mnt/test-1/data'
Feb  7 17:46:23.975: INFO: stderr: ""
Feb  7 17:46:23.975: INFO: stdout: "hello world\n"
Feb  7 17:46:25.977: INFO: Unexpected error occurred: Failed to find "hello world
hello world
", last result: "hello world
"
...
Feb  7 17:47:10.705: INFO: At 2019-02-07 17:46:15 -0500 EST - event for ebs-volume-tester-rp8kv-58f768d56f: {replicaset-controller } SuccessfulCreate: Created pod: ebs-volume-tester-rp8kv-58f768d56f-nbn6r
Feb  7 17:47:10.706: INFO: At 2019-02-07 17:46:15 -0500 EST - event for ebs-volume-tester-rp8kv-58f768d56f-nbn6r: {attachdetach-controller } FailedAttachVolume: Multi-Attach error for volume "pvc-1cf68f73-2b2a-11e9-bcab-7a58f389f9e0" Volume is already used by pod(s) ebs-volume-tester-rp8kv-58f768d56f-fvwx5

ebs-volume-tester-rp8kv-58f768d56f-fvwx5 is the original pod is being deleted, because the test didn't wait for the pod to be fully deleted the test checks that pod instead of the new pod ebs-volume-tester-rp8kv-58f768d56f-nbn6r

What testing is done?
Local testing

Waif for pod to be actually deleted before checking if the replacement pod is running
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Feb 7, 2019
@coveralls
Copy link

coveralls commented Feb 7, 2019

Pull Request Test Coverage Report for Build 418

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 64.433%

Totals Coverage Status
Change from base Build 417: 0.0%
Covered Lines: 779
Relevant Lines: 1209

💛 - Coveralls

@dkoshkin
Copy link
Contributor Author

dkoshkin commented Feb 7, 2019

/retest

Copy link
Contributor

@leakingtapan leakingtapan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 11, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dkoshkin, leakingtapan

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 11, 2019
@k8s-ci-robot k8s-ci-robot merged commit 197fb7f into kubernetes-sigs:master Feb 11, 2019
@dkoshkin dkoshkin deleted the dkoshkin/fix-delete-pod-test branch February 26, 2019 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants