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
[Test]
public async Task SendToOthersInChannelTest1()
{
for (var i = 0; i < 100; i++)
{
var channel = $"channel-{Guid.NewGuid()}";
var msg = new TestMessage { Msg = "Hello" };
var ch = Channel.CreateUnbounded<TestMessage>();
await using (var connection = await HubClient.ConnectAsync(config.Endpoint, config.TenantName, config.ClientId, accessKey)) //connect to our signalr server
await using (var connection1 = await HubClient.ConnectAsync(config.Endpoint, config.TenantName, config.ClientId, accessKey))
{
await connection.InvokeAsync<string>("JoinChannel", channel); //this will trigger a method in the server side, the server just add the connection to the channel, it will call groupManager.AddToGroupAsync(connectionId, channel, cancellationToken)
await connection1.InvokeAsync<string>("JoinChannel", channel);
connection.On<TestMessage>(Helper.DefaultMethod, receivedMsg => {
return ch.Writer.WriteAsync(receivedMsg).AsTask();
});
await connection1.InvokeAsync("SendToOthersInChannel", channel, msg); //send the msg to all other users of channel
var cts = new CancellationTokenSource();
cts.CancelAfter(TimeSpan.FromMinutes(5));
var received = await ch.Reader.ReadAsync(cts.Token);
Assert.True(received.Equals(msg), $"SendToOthersInChannelTest1({i}) receive check failed: {channel} {msg.GetType()}-{msg} {received.GetType()}-{received}");
}
}
}
This test will fail stably after run several times when I connect the server that deployed in the azure kubernetes cluster, the Message field of the received TestMessage is empty like below, but can't reproduce it when I connect to the server in my local computer.
When connect to server that deployed in the azure kubernetes cluster, I capture the traffic with fiddler, and it shows that the entire message is received. rcs.zip
I'm not sure it's an issue of signalr client or my misusage or misconfiguration, can anyone give some hints about how to fix this issue?
The text was updated successfully, but these errors were encountered:
How to reproduce
This test will fail stably after run several times when I connect the server that deployed in the azure kubernetes cluster, the Message field of the received TestMessage is empty like below, but can't reproduce it when I connect to the server in my local computer.
When connect to server that deployed in the azure kubernetes cluster, I capture the traffic with fiddler, and it shows that the entire message is received.
rcs.zip
I'm not sure it's an issue of signalr client or my misusage or misconfiguration, can anyone give some hints about how to fix this issue?
The text was updated successfully, but these errors were encountered: