From 6b177fdbaa585034dde439588663c5283f24d0f1 Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Mon, 14 Sep 2020 12:42:19 -0700 Subject: [PATCH] Tweak test threshold --- .../tests/PhysicalFileProviderTests.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/libraries/Microsoft.Extensions.FileProviders.Physical/tests/PhysicalFileProviderTests.cs b/src/libraries/Microsoft.Extensions.FileProviders.Physical/tests/PhysicalFileProviderTests.cs index 7db25d890d8a9b..56f21422360744 100644 --- a/src/libraries/Microsoft.Extensions.FileProviders.Physical/tests/PhysicalFileProviderTests.cs +++ b/src/libraries/Microsoft.Extensions.FileProviders.Physical/tests/PhysicalFileProviderTests.cs @@ -18,6 +18,7 @@ namespace Microsoft.Extensions.FileProviders public class PhysicalFileProviderTests { private const int WaitTimeForTokenToFire = 500; + private const int WaitTimeForTokenCallback = 10000; [Fact] public void GetFileInfoReturnsNotFoundFileInfoForNullPath() @@ -103,7 +104,6 @@ public void PollingFileProviderShouldntConsumeINotifyInstances() // choose an arbitrary number that exceeds max int instances = maxInstances + 16; - AutoResetEvent are = new AutoResetEvent(false); try { @@ -115,16 +115,14 @@ public void PollingFileProviderShouldntConsumeINotifyInstances() UseActivePolling = true }; disposables.Add(pfp); - disposables.Add(pfp.Watch("*").RegisterChangeCallback( - o => are.Set(), - i)); + disposables.Add(pfp.Watch("*").RegisterChangeCallback(_ => are.Set(), null)); } // trigger an event root.CreateFile("test.txt"); // wait for at least one event. - Assert.True(are.WaitOne(WaitTimeForTokenToFire)); + Assert.True(are.WaitOne(WaitTimeForTokenCallback)); } finally {