Skip to content

Fix test_webSocket hang #4973

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
Jun 7, 2024
Merged

Conversation

jrflat
Copy link
Contributor

@jrflat jrflat commented Jun 6, 2024

Because the test server sends a close message shortly after sending a pong, the connection might close before our task handles the pong and calls its completion handler. In this case, the pong completion handler is never called, so try await task.sendPing() hangs indefinitely.

This PR cleans up pongCompletionHandlers on error/close and minimally fixes the test to allow the case where the server closes the connection before the pong is handled.

@jrflat
Copy link
Contributor Author

jrflat commented Jun 6, 2024

@swift-ci please test

@jrflat jrflat requested review from parkera and etcwilde June 6, 2024 23:23
Copy link
Contributor

@etcwilde etcwilde left a comment

Choose a reason for hiding this comment

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

On initial inspection, this looks fine to me.
I've got a local 5.10 Fedora40 toolchain build going to verify and I'll be able to comment further once that finishes.

Copy link
Contributor

@etcwilde etcwilde left a comment

Choose a reason for hiding this comment

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

LGTM

Cherry-picking this back to 5.10 gets me past the hanging websocket test on Fedora40.

The macOS failure (dyld[95291]: Symbol not found: _swift_getTypeByMangledNameInContext2) is known. The OS on the test runners is too old for the latest standard library.

@jrflat jrflat merged commit d7c868a into swiftlang:main Jun 7, 2024
2 of 3 checks passed
jrflat added a commit to jrflat/swift-corelibs-foundation that referenced this pull request Jun 7, 2024
jrflat added a commit to jrflat/swift-corelibs-foundation that referenced this pull request Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants