Skip to content

Commit

Permalink
Tweak test threshold
Browse files Browse the repository at this point in the history
  • Loading branch information
ericstj committed Sep 14, 2020
1 parent cc2ea29 commit 6b177fd
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -103,7 +104,6 @@ public void PollingFileProviderShouldntConsumeINotifyInstances()
// choose an arbitrary number that exceeds max
int instances = maxInstances + 16;


AutoResetEvent are = new AutoResetEvent(false);
try
{
Expand All @@ -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
{
Expand Down

0 comments on commit 6b177fd

Please sign in to comment.