From 3f933c99f463606183710943045113accf6e87b6 Mon Sep 17 00:00:00 2001 From: Oleksandr Poliakov Date: Thu, 29 Feb 2024 11:42:31 -0800 Subject: [PATCH] CSHARP-4988: Fix flaky ServerMonitor test --- .../Core/Servers/ServerMonitorTests.cs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tests/MongoDB.Driver.Core.Tests/Core/Servers/ServerMonitorTests.cs b/tests/MongoDB.Driver.Core.Tests/Core/Servers/ServerMonitorTests.cs index 8dc8825378f..710a197116a 100644 --- a/tests/MongoDB.Driver.Core.Tests/Core/Servers/ServerMonitorTests.cs +++ b/tests/MongoDB.Driver.Core.Tests/Core/Servers/ServerMonitorTests.cs @@ -312,14 +312,8 @@ public void RoundTripTimeMonitor_should_be_started_only_once_if_using_streaming_ mockConnection.EnqueueCommandResponseMessage(CreateHeartbeatCommandResponseMessage(), null); subject.Initialize(); - // spin until the initial handshake has happened in which case the server description state should be Connected - SpinWait.SpinUntil(() => subject.Description.State == ServerState.Connected, TimeSpan.FromSeconds(5)).Should().BeTrue(); - - // RTT thread should be started after first heartbeat (initial handshake) - mockRoundTripTimeMonitor.Verify(m => m.Start(), Times.Once); SpinWait.SpinUntil(() => capturedEvents.Count >= 4, TimeSpan.FromSeconds(5)).Should().BeTrue(); - mockRoundTripTimeMonitor.Verify(m => m.Start(), Times.Once); mockRoundTripTimeMonitor.Verify(m => m.IsStarted, Times.AtLeast(4)); subject.Dispose();