Skip to content

Commit

Permalink
Update BlockingCollectionTests.cs
Browse files Browse the repository at this point in the history
Remove comments about bug details
  • Loading branch information
YingP99 committed Jan 17, 2015
1 parent 109d024 commit 2d3f6fa
Showing 1 changed file with 3 additions and 20 deletions.
23 changes: 3 additions & 20 deletions src/System.Collections.Concurrent/tests/BlockingCollectionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,7 @@ public static void RunBlockingCollectionTest_BugFix544259()
bc.CompleteAdding();
}

// as part of the bugfix for 626345, this code was suffering occassional ObjectDisposedExceptions due
// to the expected race between cts.Dispose and the cts.Cancel coming from the linking sources.
// ML: update - since the change to wait as part of CTS.Dispose, the ODE no longer occurs
// but we keep the test as a good example of how cleanup of linkedCTS must be carefully handled to prevent
// This test shows how to cleanup of linkedCTS must be carefully handled to prevent
// users of the source CTS mistakenly calling methods on disposed targets.
[Fact]
[OuterLoop]
Expand Down Expand Up @@ -144,26 +141,12 @@ public static void RunBlockingCollectionTest_Bug626345()
//Wait for the producers to finish.
//It is possible for some of the tasks in the array to be null, because the
//test was cancelled before all the tasks were creates, so we filter out the null values
foreach (Task t in producers)
{
if (t != null)
{
t.Wait();
//t.Join();
}
}
Task.WaitAll(producers);

m_BlockingQueueUnderTest.CompleteAdding(); //signal all producers are done adding items

//Wait for the consumers to finish.
foreach (Task t in consumers)
{
if (t != null)
{
t.Wait();
//t.Join();
}
}
Task.WaitAll(consumers);

// success is not suffering exceptions.
}
Expand Down

0 comments on commit 2d3f6fa

Please sign in to comment.