Skip to content
This repository was archived by the owner on Mar 13, 2022. It is now read-only.

Fix replication controller pods delete in tests #244

Merged
merged 1 commit into from
Aug 15, 2021

Conversation

hedrox
Copy link
Contributor

@hedrox hedrox commented Jun 27, 2021

What type of PR is this?

/kind bug

What this PR does / why we need it:

Tests that create Replication Controller objects don't clean pods upon deletion

Which issue(s) this PR fixes:

Fixes #242

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jun 27, 2021
@k8s-ci-robot k8s-ci-robot requested review from roycaihw and yliaog June 27, 2021 16:54
@k8s-ci-robot
Copy link
Contributor

Welcome @hedrox!

It looks like this is your first PR to kubernetes-client/python-base 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-client/python-base has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jun 27, 2021
@roycaihw
Copy link
Member

/assign @yliaog

self.assertEqual(
[],
pods.items,
'ReplicationController pods were not deleted in the 60 sec interval')
Copy link
Contributor

Choose a reason for hiding this comment

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

'Background' would do the pod deletion in the background, it does not guarantee that the pods are deleted in specific amount of time. 60s is arbitrary, the pods may, or may not be deleted during that interval. hence the test is flaky.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is it ok if I remove the check that the pods have been deleted? This would leave the test as it was, but now it would have the propagation policy fix. Any other solution that I have involves waiting forever either for the pods in case of the 'Background' policy, or for the ReplicationController in case of the 'Foreground' policy.

Copy link
Contributor

Choose a reason for hiding this comment

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

have you verified manually that the pods are deleted eventually with 'Background'?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I have. If you want I could change it to 'Foreground', but from my manual tests both the policies work.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think 'Background' is fine.

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 20, 2021
@hedrox
Copy link
Contributor Author

hedrox commented Aug 15, 2021

@roycaihw please tell me if there is anything I can do to help the review process. Thank you for your time.

@yliaog
Copy link
Contributor

yliaog commented Aug 15, 2021

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 15, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hedrox, yliaog

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 Aug 15, 2021
@k8s-ci-robot k8s-ci-robot merged commit dd15ac6 into kubernetes-client:master Aug 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ReplicationController delete propagation policy
4 participants