Skip to content

frontend: Add webSocket polling and initial timeouts#4034

Closed
joaquimrocha wants to merge 1 commit intokubernetes-sigs:mainfrom
joaquimrocha:fix-websockets-tests
Closed

frontend: Add webSocket polling and initial timeouts#4034
joaquimrocha wants to merge 1 commit intokubernetes-sigs:mainfrom
joaquimrocha:fix-websockets-tests

Conversation

@joaquimrocha
Copy link
Copy Markdown
Contributor

@joaquimrocha joaquimrocha commented Oct 13, 2025

Summary

This change will avoid tests failing unexpectedly.

Separated from #3953 .

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Oct 13, 2025
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: joaquimrocha

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

The pull request process is described 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

@k8s-ci-robot k8s-ci-robot requested a review from ashu8912 October 13, 2025 15:28
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 13, 2025
@k8s-ci-robot k8s-ci-robot requested a review from yolossn October 13, 2025 15:28
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Oct 13, 2025
@illume illume requested a review from Copilot October 13, 2025 16:04
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds timeout functionality to WebSocket connections to prevent tests from hanging indefinitely. The changes introduce proper error handling with timeouts for both existing connection waits and new connection attempts.

  • Added 5-second timeout for WebSocket connection attempts
  • Enhanced connection polling with timeout and failure detection
  • Updated test expectations to match new timeout error messages

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
frontend/src/lib/k8s/api/v2/webSocket.ts Added timeout logic for WebSocket connections and improved polling mechanism
frontend/src/lib/k8s/api/v2/webSocket.test.ts Updated test expectation to match new timeout error message

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread frontend/src/lib/k8s/api/v2/webSocket.ts Outdated
Comment thread frontend/src/lib/k8s/api/v2/webSocket.ts Outdated
@illume illume marked this pull request as draft October 15, 2025 10:28
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 15, 2025
@joaquimrocha joaquimrocha force-pushed the fix-websockets-tests branch 4 times, most recently from e10a58b to e52cc26 Compare October 17, 2025 09:37
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Oct 17, 2025
@joaquimrocha joaquimrocha force-pushed the fix-websockets-tests branch 2 times, most recently from 6a41b87 to 9020964 Compare October 17, 2025 09:51
To avoid tests failing unexpectedly.
@joaquimrocha
Copy link
Copy Markdown
Contributor Author

I've closed the PR where this change was needed. So I don't think this is needed in the end.

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. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. 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