Fix testServerHandleInitialize flake (#68)
This commit is contained in:
parent
960c1dda0b
commit
2a978d175e
1 changed files with 8 additions and 4 deletions
|
|
@ -39,15 +39,19 @@ struct ServerTests {
|
||||||
try await server.start(transport: transport)
|
try await server.start(transport: transport)
|
||||||
|
|
||||||
// Wait for message processing and response
|
// Wait for message processing and response
|
||||||
try await Task.sleep(nanoseconds: 10_000_000) // 10ms
|
try await Task.sleep(nanoseconds: 100_000_000) // 100ms
|
||||||
|
|
||||||
#expect(await transport.sentMessages.count == 1)
|
#expect(await transport.sentMessages.count == 2)
|
||||||
|
|
||||||
let messages = await transport.sentMessages
|
let messages = await transport.sentMessages
|
||||||
if let response = messages.first {
|
if let response = messages.first {
|
||||||
#expect(response.contains("serverInfo"))
|
#expect(response.contains("serverInfo"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let noticiation = messages.last {
|
||||||
|
#expect(noticiation.contains("initialized"))
|
||||||
|
}
|
||||||
|
|
||||||
// Clean up
|
// Clean up
|
||||||
await server.stop()
|
await server.stop()
|
||||||
await transport.disconnect()
|
await transport.disconnect()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue