Skip to content

test(utils): make keepalive tests pass on macOS - #2749

Open
ArfiArfath21 wants to merge 1 commit into
kubernetes-client:masterfrom
ArfiArfath21:keepalive-tests-macos
Open

ArfiArfath21 wants to merge 1 commit into
kubernetes-client:masterfrom
ArfiArfath21:keepalive-tests-macos

Conversation

@ArfiArfath21

Copy link
Copy Markdown

What type of PR is this?

/kind failing-test

What this PR does / why we need it:

kubernetes/utils/keepalive_test.py failed on macOS: it referenced socket.TCP_KEEPIDLE, which macOS does not define (it uses TCP_KEEPALIVE; keepalive.py already handles that), and expected getsockopt(SO_KEEPALIVE) to read back as exactly 1 while macOS returns a non-zero flag (8). The tests now resolve the idle option the same way keepalive.py does, skip when the platform has neither, and assert a non-zero value for the boolean option. No library code changes.

Which issue(s) this PR fixes:

Related to #2747 (test-only change, so not using Fixes).

Special notes for your reviewer:

On macOS, 3 of 11 tests in this file failed on master and all 11 pass with this change. Behaviour on Linux is unchanged.

AI assistance disclosure: prepared with Claude Code; I reviewed the change and ran the tests locally.

Does this PR introduce a user-facing change?

NONE

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


@kubernetes-prow kubernetes-prow Bot added release-note-none Denotes a PR that doesn't merit a release note. kind/failing-test Categorizes issue or PR as related to a consistently or frequently failing test. labels Oct 16, 2026
@kubernetes-prow
kubernetes-prow Bot requested review from roycaihw and yliaog October 16, 2026 18:16
@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ArfiArfath21
Once this PR has been reviewed and has the lgtm label, please assign yliaog for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details 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

@linux-foundation-easycla

linux-foundation-easycla Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: ArfiArfath21 / name: ArfiArfath21 (85cf84c)

@kubernetes-prow kubernetes-prow Bot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Oct 16, 2026
@ArfiArfath21
ArfiArfath21 force-pushed the keepalive-tests-macos branch from ef179e4 to ddedb1f Compare October 16, 2026 18:17
@ArfiArfath21

Copy link
Copy Markdown
Author

/easycla

The tests referenced socket.TCP_KEEPIDLE, which macOS does not define (it
uses TCP_KEEPALIVE; keepalive.py already handles this), and expected
SO_KEEPALIVE to read back as exactly 1, but macOS returns a non-zero flag.
@ArfiArfath21
ArfiArfath21 force-pushed the keepalive-tests-macos branch from ddedb1f to 85cf84c Compare October 16, 2026 18:23
@ArfiArfath21

Copy link
Copy Markdown
Author

/easycla

@kubernetes-prow kubernetes-prow Bot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/failing-test Categorizes issue or PR as related to a consistently or frequently failing test. 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.

1 participant