perf: consume parser command views in client hot path
This commit is contained in:
@@ -232,6 +232,35 @@ public class ClientProtocolGoParityTests
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Split_pub_payload_is_delivered_across_client_reads()
|
||||
{
|
||||
var (server, port, cts) = await StartServerAsync();
|
||||
try
|
||||
{
|
||||
using var sub = await ConnectAndPingAsync(port);
|
||||
using var pub = await ConnectAndPingAsync(port);
|
||||
|
||||
await sub.SendAsync(Encoding.ASCII.GetBytes("SUB foo 1\r\nPING\r\n"));
|
||||
await SocketTestHelper.ReadUntilAsync(sub, "PONG\r\n");
|
||||
|
||||
await pub.SendAsync(Encoding.ASCII.GetBytes("PUB foo 5\r\nHe"));
|
||||
await Task.Delay(25);
|
||||
await pub.SendAsync(Encoding.ASCII.GetBytes("llo\r\nPING\r\n"));
|
||||
await SocketTestHelper.ReadUntilAsync(pub, "PONG\r\n");
|
||||
|
||||
await sub.SendAsync(Encoding.ASCII.GetBytes("PING\r\n"));
|
||||
var response = await SocketTestHelper.ReadUntilAsync(sub, "PONG\r\n");
|
||||
|
||||
response.ShouldContain("MSG foo 1 5\r\nHello\r\n");
|
||||
}
|
||||
finally
|
||||
{
|
||||
await cts.CancelAsync();
|
||||
server.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
// =========================================================================
|
||||
// TestTraceMsg — client_test.go:1700
|
||||
// Tests that trace message formatting truncates correctly.
|
||||
|
||||
Reference in New Issue
Block a user