diff --git a/test/Exceptionless.Tests/Storage/PersistedDictionaryTests.cs b/test/Exceptionless.Tests/Storage/PersistedDictionaryTests.cs index 2de89922..7266f681 100644 --- a/test/Exceptionless.Tests/Storage/PersistedDictionaryTests.cs +++ b/test/Exceptionless.Tests/Storage/PersistedDictionaryTests.cs @@ -15,7 +15,7 @@ public void WillBeSaved() { dict.Saved += (sender, args) => resetEvent.Set(); dict["test"] = "test"; Assert.Equal("test", dict["test"]); - bool success = resetEvent.WaitOne(250); + bool success = resetEvent.WaitOne(500); Assert.True(success, "Failed to save dictionary."); Assert.True(storage.Exists("test.json")); } @@ -29,14 +29,14 @@ public void WillSaveOnce() { for (int i = 0; i < 10; i++) dict["test" + i] = i.ToString(); Assert.Equal(10, dict.Count); - bool success = latch.Wait(250); + bool success = latch.Wait(500); Assert.False(success, "Dictionary was saved multiple times."); Assert.Equal(1, latch.Remaining); Assert.True(storage.Exists("test.json")); dict["test"] = "test"; Assert.Equal(11, dict.Count); - success = latch.Wait(250); + success = latch.Wait(500); Assert.True(success, "Failed to save dictionary."); Assert.True(storage.Exists("test.json")); } diff --git a/test/Exceptionless.Tests/Utility/CountDownLatch.cs b/test/Exceptionless.Tests/Utility/CountDownLatch.cs index 8f5ab43a..9268f951 100644 --- a/test/Exceptionless.Tests/Utility/CountDownLatch.cs +++ b/test/Exceptionless.Tests/Utility/CountDownLatch.cs @@ -4,7 +4,7 @@ namespace Exceptionless.Tests.Utility { public class CountDownLatch { private int _remaining; - private EventWaitHandle _event; + private ManualResetEventSlim _event; public CountDownLatch(int count) { Reset(count); @@ -14,7 +14,7 @@ public void Reset(int count) { if (count < 0) throw new ArgumentOutOfRangeException(); _remaining = count; - _event = new ManualResetEvent(false); + _event = new ManualResetEventSlim(false); if (_remaining == 0) _event.Set(); } @@ -26,7 +26,7 @@ public void Signal() { } public bool Wait(int millisecondsTimeout) { - return _event.WaitOne(millisecondsTimeout); + return _event.Wait(millisecondsTimeout); } public int Remaining { get { return _remaining; } }