Pārlūkot izejas kodu

Fix failing test

Marek Safar 13 gadi atpakaļ
vecāks
revīzija
146a289d36

+ 3 - 0
mcs/class/corlib/Test/System.Threading.Tasks/TaskTest.cs

@@ -679,9 +679,11 @@ namespace MonoTests.System.Threading.Tasks
 		public void WaitingForChildrenToComplete ()
 		{
 			Task nested = null;
+			var mre = new ManualResetEvent (false);
 
 			parent_wfc = Task.Factory.StartNew (() => {
 				nested = Task.Factory.StartNew (() => {
+					Assert.IsTrue (mre.WaitOne (4000), "parent_wfc needs to be set first");
 					Assert.IsFalse (parent_wfc.Wait (10), "#1a");
 					Assert.AreEqual (TaskStatus.WaitingForChildrenToComplete, parent_wfc.Status, "#1b");
 				}, TaskCreationOptions.AttachedToParent).ContinueWith (l => {
@@ -690,6 +692,7 @@ namespace MonoTests.System.Threading.Tasks
 				}, TaskContinuationOptions.ExecuteSynchronously);
 			});
 
+			mre.Set ();
 			Assert.IsTrue (parent_wfc.Wait (2000), "#3");
 			Assert.IsTrue (nested.Wait (2000), "#4");
 		}