You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: kotlin-sdk-test/src/commonTest/kotlin/io/modelcontextprotocol/kotlin/sdk/integration/WebSocketIntegrationTest.kt
+12-9Lines changed: 12 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -42,7 +42,8 @@ class WebSocketIntegrationTest {
42
42
withContext(Dispatchers.Default) {
43
43
withTimeout(1000) {
44
44
server = initServer()
45
-
client = initClient()
45
+
val port = server.engine.resolvedConnectors().first().port
46
+
client = initClient(serverPort = port)
46
47
}
47
48
}
48
49
} finally {
@@ -67,7 +68,8 @@ class WebSocketIntegrationTest {
67
68
withContext(Dispatchers.Default) {
68
69
withTimeout(1000) {
69
70
server = initServer()
70
-
client = initClient()
71
+
val port = server.engine.resolvedConnectors().first().port
72
+
client = initClient("Client A", port)
71
73
72
74
val promptA = getPrompt(client, "Client A")
73
75
assertTrue { "Client A"in promptA }
@@ -97,8 +99,9 @@ class WebSocketIntegrationTest {
97
99
withContext(Dispatchers.Default) {
98
100
withTimeout(1000) {
99
101
server = initServer()
100
-
clientA = initClient()
101
-
clientB = initClient()
102
+
val port = server.engine.resolvedConnectors().first().port
103
+
clientA = initClient("Client A", port)
104
+
clientB = initClient("Client B",port)
102
105
103
106
// Step 3: Send a prompt request from Client A
104
107
val promptA = getPrompt(clientA, "Client A")
@@ -116,7 +119,7 @@ class WebSocketIntegrationTest {
0 commit comments