Skip to content

Fixed watch_test.py indentation error #2437

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

Merged
merged 1 commit into from
Aug 18, 2025

Conversation

yliaog
Copy link
Contributor

@yliaog yliaog commented Aug 14, 2025

Fixed watch_test.py indentation error

./kubernetes/base/watch/watch_test.py:580:2: E999 IndentationError: expected an indented block after 'if' statement on line 579 def test_watch_with_deserialize_param(self):
^
1 E999 IndentationError: expected an indented block after 'if' statement on line 579

Fixed the ws_client_test.py address already in use error

What type of PR is this?

/kind bug

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #

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 Aug 14, 2025
@k8s-ci-robot k8s-ci-robot requested a review from roycaihw August 14, 2025 21:33
@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 14, 2025
@yliaog
Copy link
Contributor Author

yliaog commented Aug 14, 2025

/assign @roycaihw

@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Aug 14, 2025
@yliaog yliaog force-pushed the master branch 2 times, most recently from 3a819d6 to c6d53b6 Compare August 14, 2025 21:37
@yliaog
Copy link
Contributor Author

yliaog commented Aug 14, 2025

/close

@k8s-ci-robot
Copy link
Contributor

@yliaog: Closed this PR.

In response to this:

/close

Instructions 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.

@yliaog
Copy link
Contributor Author

yliaog commented Aug 14, 2025

/reopen

@k8s-ci-robot k8s-ci-robot reopened this Aug 14, 2025
@k8s-ci-robot
Copy link
Contributor

@yliaog: Reopened this PR.

In response to this:

/reopen

Instructions 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.

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Aug 14, 2025
@yliaog yliaog changed the title comment out the second run of flake8, it is causing ci failures Fixed watch_test.py indentation error Aug 14, 2025
@yliaog
Copy link
Contributor Author

yliaog commented Aug 14, 2025

/close

@k8s-ci-robot
Copy link
Contributor

@yliaog: Closed this PR.

In response to this:

/close

Instructions 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.

@yliaog
Copy link
Contributor Author

yliaog commented Aug 14, 2025

/reopen

@k8s-ci-robot k8s-ci-robot reopened this Aug 14, 2025
@k8s-ci-robot
Copy link
Contributor

@yliaog: Reopened this PR.

In response to this:

/reopen

Instructions 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.

Copy link
Member

@roycaihw roycaihw left a comment

Choose a reason for hiding this comment

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

I think there is an extra if __name__ == '__main__': that we should delete

@@ -577,43 +579,43 @@ def test_pod_log_empty_lines(self):
self.api.delete_namespaced_pod.assert_called_once_with(name=pod_name, namespace=self.namespace)

if __name__ == '__main__':
Copy link
Member

Choose a reason for hiding this comment

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

@yliaog I think we should remove this line. The indentation below doesn't have to change. Also note that there is another if __name__ == '__main__': towards the end of this file-- that's the correct if __name__ == '__main__': that we should keep. WDYT?

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, that's right.

@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 15, 2025
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Aug 15, 2025
@yliaog
Copy link
Contributor Author

yliaog commented Aug 15, 2025

/close

@k8s-ci-robot
Copy link
Contributor

@yliaog: Closed this PR.

In response to this:

/close

Instructions 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.

@yliaog
Copy link
Contributor Author

yliaog commented Aug 15, 2025

/reopen

@k8s-ci-robot k8s-ci-robot reopened this Aug 15, 2025
@k8s-ci-robot
Copy link
Contributor

@yliaog: Reopened this PR.

In response to this:

/reopen

Instructions 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.

@yliaog yliaog force-pushed the master branch 3 times, most recently from 157413b to aaf386e Compare August 16, 2025 16:34
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 16, 2025
@yliaog yliaog force-pushed the master branch 2 times, most recently from da5bfcf to 8f0d1f8 Compare August 16, 2025 17:08
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 16, 2025
does not work currently.

./kubernetes/base/watch/watch_test.py:580:2: E999 IndentationError: expected an indented block after 'if' statement on line 579
def test_watch_with_deserialize_param(self):
 ^
1     E999 IndentationError: expected an indented block after 'if' statement on line 579

Fixed the ws_client_test.py address already in use error
@@ -69,7 +69,7 @@ def __init__(self, host='127.0.0.1', port=8888):
self.received_connect = False
self._server_sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self._server_sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
self._server_sock.bind((self.host, self.port))
self._server_sock.bind((self.host, 0))
Copy link
Member

Choose a reason for hiding this comment

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

Could you help me understand why we use 0 port here instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

0 means it asks OS to allocate a free port, it is to fixe the ws_client_test.py address already in use error.

Copy link
Member

@roycaihw roycaihw 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
Thanks!

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: roycaihw, 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 merged commit 06fd307 into kubernetes-client:master Aug 18, 2025
10 checks passed
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. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants