Merge pull request #1857 from slluis/fix-assembly-resolver
[mono.git] / mcs / class / corlib / Test / System.Threading.Tasks / TaskTest.cs
index d32e2d7ebb8bc7188848278991f32f2ec2267d78..d3ce52f88e831094a37d9307ead9bbe2f0f56625 100644 (file)
@@ -345,7 +345,7 @@ namespace MonoTests.System.Threading.Tasks
                        CountdownEvent cde = new CountdownEvent (2);
                        var mre = new ManualResetEvent (false);
                        var tasks = new[] {
-                               Task.Factory.StartNew (delegate { mre.WaitOne (); }),
+                               Task.Factory.StartNew (delegate { Assert.IsTrue (mre.WaitOne (1500), "#0"); }),
                                Task.Factory.StartNew (delegate { try { throw new ApplicationException (); } finally { cde.Signal (); } }),
                                Task.Factory.StartNew (delegate { try { throw new ApplicationException (); } finally { cde.Signal (); } })
                        };
@@ -356,7 +356,7 @@ namespace MonoTests.System.Threading.Tasks
                        mre.Set ();
 
                        try {
-                               Assert.IsTrue (Task.WaitAll (tasks, 1000), "#3");
+                               Task.WaitAll (tasks, 1000);
                                Assert.Fail ("#4");
                        } catch (AggregateException e) {
                                Assert.AreEqual (2, e.InnerExceptions.Count, "#5");
@@ -1159,7 +1159,7 @@ namespace MonoTests.System.Threading.Tasks
                        });
                        var onErrorTask = testTask.ContinueWith (x => continuationRan = true, TaskContinuationOptions.OnlyOnFaulted);
                        testTask.RunSynchronously ();
-                       onErrorTask.Wait (100);
+                       onErrorTask.Wait (1000);
                        Assert.IsNotNull (e);
                        Assert.IsTrue (continuationRan);
                }
@@ -1889,7 +1889,7 @@ namespace MonoTests.System.Threading.Tasks
                        bool? is_bg = null;
                        var t = new Task (() => { is_tp = Thread.CurrentThread.IsThreadPoolThread; is_bg = Thread.CurrentThread.IsBackground; });
                        t.Start ();
-                       t.Wait ();
+                       Assert.IsTrue (t.Wait (5000), "#0");
                        Assert.IsTrue ((bool)is_tp, "#1");
                        Assert.IsTrue ((bool)is_bg, "#2");
 
@@ -1897,7 +1897,7 @@ namespace MonoTests.System.Threading.Tasks
                        is_bg = null;
                        t = new Task (() => { is_tp = Thread.CurrentThread.IsThreadPoolThread; is_bg = Thread.CurrentThread.IsBackground; }, TaskCreationOptions.LongRunning);
                        t.Start ();
-                       t.Wait ();
+                       Assert.IsTrue (t.Wait (5000), "#10");
                        Assert.IsFalse ((bool) is_tp, "#11");
                        Assert.IsTrue ((bool) is_bg, "#12");
                }