Fix deserialization in read buffer (#225)
* Add deserialization error processing * Add test
This commit is contained in:
parent
ad8205297e
commit
9bb851aba2
1 changed files with 31 additions and 1 deletions
|
|
@ -45,4 +45,24 @@ class StdioClientTransportTest : BaseTransportTest() {
|
|||
process.waitFor()
|
||||
process.destroy()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `should ignore first output messages`() = runTest {
|
||||
val processBuilder = ProcessBuilder("/usr/bin/tee")
|
||||
val process = processBuilder.start()
|
||||
process.outputStream.write("Stdio server started".toByteArray())
|
||||
|
||||
val input = process.inputStream.asSource().buffered()
|
||||
val output = process.outputStream.asSink().buffered()
|
||||
|
||||
val client = StdioClientTransport(
|
||||
input = input,
|
||||
output = output,
|
||||
)
|
||||
|
||||
testClientRead(client)
|
||||
|
||||
process.waitFor()
|
||||
process.destroy()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue