From 505684361195b595e1ab194a3ff622cd5d0e0768 Mon Sep 17 00:00:00 2001 From: Christian Kratky Date: Sat, 25 Jul 2020 14:21:09 +0200 Subject: [PATCH] Fix UnitTests. --- Tests/MQTTnet.Core.Tests/Server_Tests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/MQTTnet.Core.Tests/Server_Tests.cs b/Tests/MQTTnet.Core.Tests/Server_Tests.cs index af1b715..ef58d69 100644 --- a/Tests/MQTTnet.Core.Tests/Server_Tests.cs +++ b/Tests/MQTTnet.Core.Tests/Server_Tests.cs @@ -304,7 +304,7 @@ namespace MQTTnet.Tests await c2.PublishAsync(messageBuilder.Build()).ConfigureAwait(false); } - await Task.Delay(500).ConfigureAwait(false); + SpinWait.SpinUntil(() => receivedMessagesCount == 1000, 2000); Assert.AreEqual(1000, receivedMessagesCount); } @@ -340,7 +340,7 @@ namespace MQTTnet.Tests await c2.PublishAsync(messageBuilder.Build()).ConfigureAwait(false); } - await Task.Delay(500).ConfigureAwait(false); + SpinWait.SpinUntil(() => receivedMessagesCount == 1000, 2000); Assert.AreEqual(1000, receivedMessagesCount); }