Skip to content
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.

Commit

Permalink
Fixing race in unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastienros committed Mar 28, 2016
1 parent 749a51e commit 49e0a95
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,7 @@ public async Task ProcessAsync_ExceptionInProcessing_DoesntBlockConcurrentReques
var childContent = "some-content";
var resetEvent1 = new ManualResetEvent(false);
var resetEvent2 = new ManualResetEvent(false);
var resetEvent3 = new ManualResetEvent(false);
var calls = 0;
var formatter = GetFormatter();
var storage = GetStorage();
Expand Down Expand Up @@ -854,6 +855,7 @@ public async Task ProcessAsync_ExceptionInProcessing_DoesntBlockConcurrentReques
getChildContentAsync: (useCachedResult, encoder) =>
{
calls++;
resetEvent3.WaitOne(5000);

var tagHelperContent = new DefaultTagHelperContent();
tagHelperContent.SetHtmlContent(childContent);
Expand Down Expand Up @@ -882,6 +884,7 @@ public async Task ProcessAsync_ExceptionInProcessing_DoesntBlockConcurrentReques
{
resetEvent1.WaitOne(5000);
await Assert.ThrowsAsync<Exception>(() => cacheTagHelper1.ProcessAsync(tagHelperContext1, tagHelperOutput1));
resetEvent3.Set();
});

var task2 = Task.Run(async () =>
Expand Down

0 comments on commit 49e0a95

Please sign in to comment.