mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-18 02:13:00 +08:00
Fix Unit Tests.
This commit is contained in:
@@ -104,7 +104,7 @@ namespace MQTTnet.Server
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
_logger.Error(exception, "Client '{0}': Error while sending DISCONNECT packet after takeover.", ClientId);
|
||||
_logger.Warning(exception, "Client '{0}': Error while sending DISCONNECT packet after takeover.", ClientId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -304,7 +304,7 @@ namespace MQTTnet.Tests
|
||||
await c2.PublishAsync(messageBuilder.Build()).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
SpinWait.SpinUntil(() => receivedMessagesCount == 500, 5000);
|
||||
SpinWait.SpinUntil(() => receivedMessagesCount == 500, TimeSpan.FromSeconds(15));
|
||||
|
||||
Assert.AreEqual(500, receivedMessagesCount);
|
||||
}
|
||||
@@ -445,7 +445,7 @@ namespace MQTTnet.Tests
|
||||
await c1.PublishAsync(message).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
SpinWait.SpinUntil(() => receivedMessagesCount == 1000, TimeSpan.FromSeconds(10));
|
||||
SpinWait.SpinUntil(() => receivedMessagesCount == 1000, TimeSpan.FromSeconds(15));
|
||||
|
||||
Assert.AreEqual(1000, receivedMessagesCount);
|
||||
}
|
||||
@@ -953,7 +953,8 @@ namespace MQTTnet.Tests
|
||||
|
||||
byte[] receivedBody = null;
|
||||
|
||||
await testEnvironment.StartServerAsync(new MqttServerOptionsBuilder());
|
||||
await testEnvironment.StartServerAsync();
|
||||
|
||||
var client1 = await testEnvironment.ConnectClientAsync();
|
||||
client1.UseApplicationMessageReceivedHandler(c =>
|
||||
{
|
||||
@@ -965,7 +966,7 @@ namespace MQTTnet.Tests
|
||||
var client2 = await testEnvironment.ConnectClientAsync();
|
||||
await client2.PublishAsync("string", longBody);
|
||||
|
||||
await Task.Delay(500);
|
||||
await Task.Delay(TimeSpan.FromSeconds(5));
|
||||
|
||||
Assert.IsTrue(longBody.SequenceEqual(receivedBody ?? new byte[0]));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user