From bade966af987eafb5144b6298035d6155db3d8f0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 2 Mar 2026 20:25:01 +0000 Subject: [PATCH] Reduce unit test sleep times and loop iterations to speed up test suite Co-authored-by: HakanL <407941+HakanL@users.noreply.github.com> --- Seq.Client.WindowsLogins.Tests/EventTests.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Seq.Client.WindowsLogins.Tests/EventTests.cs b/Seq.Client.WindowsLogins.Tests/EventTests.cs index 0fe382f..e8ce649 100644 --- a/Seq.Client.WindowsLogins.Tests/EventTests.cs +++ b/Seq.Client.WindowsLogins.Tests/EventTests.cs @@ -63,7 +63,7 @@ public void EventBagExpiresEvent() var unused = new EventLogListener(2); EventLogListener.EventList.Add(1000); Assert.True(EventLogListener.EventList.Contains(1000)); - Thread.Sleep(3000); + Thread.Sleep(2000); Assert.False(EventLogListener.EventList.Contains(1000)); } @@ -79,7 +79,7 @@ public void EventBagKeepsAccessedEvent() EventLogListener.EventList.Add(1000); - for (var i = 1; i < 2001; i++) + for (var i = 1; i < 301; i++) { var count = EventLogListener.EventList.Count; if (i % 100 == 0) @@ -95,7 +95,7 @@ public void EventBagKeepsAccessedEvent() } /// - /// A long test (60 seconds) that allows us to observe cache population and expiry + /// A test that allows us to observe cache population and expiry /// [Fact] public void EventBagPopulationAndExpiry() @@ -106,8 +106,8 @@ public void EventBagPopulationAndExpiry() var random = new Random(); new Thread(delegate() { - //Populate the cache for ~30 seconds so it will expire before the test has finished - for (var i = 1; i < 1001; i++) + //Populate the cache for ~5 seconds so it will expire before the test has finished + for (var i = 1; i < 201; i++) { EventLogListener.EventList.Add(random.Next(1000, 100000)); var tCount = EventLogListener.EventList.Count; @@ -119,7 +119,7 @@ public void EventBagPopulationAndExpiry() }).Start(); var hasExpired = false; - for (var x = 1; x < 4001; x++) + for (var x = 1; x < 1001; x++) { Thread.Sleep(10); var count = EventLogListener.EventList.Count;