Relocate WebSocketIntegrationTest from commonTest to jvmTest#352
Merged
Relocate WebSocketIntegrationTest from commonTest to jvmTest#352
WebSocketIntegrationTest from commonTest to jvmTest#352Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR updates the WebSocket integration tests to enable them and use non-suspend Ktor server lifecycle methods. The tests were previously disabled due to compatibility issues with wasm/js in Ktor 3.2.3.
- Removed
@Ignoreannotations to re-enable the WebSocket integration tests - Changed server lifecycle methods from
startSuspend/stopSuspendtostart/stop - Updated the package name to include the full path hierarchy
Comments suppressed due to low confidence (4)
kotlin-sdk-test/src/jvmTest/kotlin/io/modelcontextprotocol/kotlin/sdk/integration/kotlin/websocket/WebSocketIntegrationTest.kt:48
- The
stopmethod is blocking and should not be called from a coroutine context withoutwithContext(Dispatchers.IO). Since this is in afinallyblock of arunTest, this could block the test dispatcher. Consider wrapping inwithContext(Dispatchers.IO)or using a suspend alternative if available.
kotlin-sdk-test/src/jvmTest/kotlin/io/modelcontextprotocol/kotlin/sdk/integration/kotlin/websocket/WebSocketIntegrationTest.kt:75 - The
stopmethod is blocking and should not be called from a coroutine context withoutwithContext(Dispatchers.IO). Since this is in afinallyblock of arunTest, this could block the test dispatcher. Consider wrapping inwithContext(Dispatchers.IO)or using a suspend alternative if available.
kotlin-sdk-test/src/jvmTest/kotlin/io/modelcontextprotocol/kotlin/sdk/integration/kotlin/websocket/WebSocketIntegrationTest.kt:111 - The
stopmethod is blocking and should not be called from a coroutine context withoutwithContext(Dispatchers.IO). Since this is in afinallyblock of arunTest, this could block the test dispatcher. Consider wrapping inwithContext(Dispatchers.IO)or using a suspend alternative if available.
kotlin-sdk-test/src/jvmTest/kotlin/io/modelcontextprotocol/kotlin/sdk/integration/kotlin/websocket/WebSocketIntegrationTest.kt:174 - The
startmethod is blocking and called from a non-suspend function that's invoked withinwithContext(Dispatchers.Default). This blocking call could impact performance. Consider wrapping inrunBlockingor usingstartSuspendif available to maintain consistency with the asynchronous nature of the test.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…`start` in `WebSocketIntegrationTest`.
6e2c83b to
d7401d8
Compare
tiginamaria
approved these changes
Oct 30, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With Ktor 3.2.3, tests don’t work correctly with wasm, so the websocket tests were moved to the jvm target as the most important one
How Has This Been Tested?
local
Breaking Changes
None
Types of changes
Checklist