From: Koundinya Veluri Date: Wed, 6 Jun 2018 17:09:29 +0000 (-0700) Subject: Increase timeout and log the result for some WaitAny tests that expect AbandonedMutex... X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d12a99d4c4fc789ec40ab492e6625a9898fb711a;p=platform%2Fupstream%2Fcoreclr.git Increase timeout and log the result for some WaitAny tests that expect AbandonedMutexException (#18312) Follow-up to https://github.com/dotnet/coreclr/pull/13298, missed a few cases. --- diff --git a/tests/src/baseservices/threading/waithandle/waitany/waitanyex2a.cs b/tests/src/baseservices/threading/waithandle/waitany/waitanyex2a.cs index da9115f01e..0f94f8064f 100644 --- a/tests/src/baseservices/threading/waithandle/waitany/waitanyex2a.cs +++ b/tests/src/baseservices/threading/waithandle/waitany/waitanyex2a.cs @@ -36,7 +36,7 @@ class WaitAnyEx { Console.WriteLine("Waiting..."); int i = WaitHandle.WaitAny( - new WaitHandle[]{myMutex, myMRE}); + new WaitHandle[]{myMutex, myMRE}, 30000); Console.WriteLine("WaitAny did not throw AbandonedMutexException. Result: {0}", i); } catch(AbandonedMutexException) diff --git a/tests/src/baseservices/threading/waithandle/waitany/waitanyex4.cs b/tests/src/baseservices/threading/waithandle/waitany/waitanyex4.cs index a67aa329c6..96b538550a 100644 --- a/tests/src/baseservices/threading/waithandle/waitany/waitanyex4.cs +++ b/tests/src/baseservices/threading/waithandle/waitany/waitanyex4.cs @@ -29,8 +29,8 @@ class WaitAnyEx try { Console.WriteLine("Waiting..."); - int i = WaitHandle.WaitAny(wh, 5000); - Console.WriteLine("WaitAny did not throw an exception"); + int i = WaitHandle.WaitAny(wh, 30000); + Console.WriteLine("WaitAny did not throw AbandonedMutexException. Result: {0}", i); } catch(AbandonedMutexException) { @@ -43,10 +43,9 @@ class WaitAnyEx private void AbandonOne() { - Mutex m = new Mutex(); foreach(WaitHandle w in wh) { - if(w.GetType() == m.GetType()) + if(w is Mutex) { w.WaitOne(); break; diff --git a/tests/src/baseservices/threading/waithandle/waitany/waitanyex4a.cs b/tests/src/baseservices/threading/waithandle/waitany/waitanyex4a.cs index e3e45567e2..5288e3572c 100644 --- a/tests/src/baseservices/threading/waithandle/waitany/waitanyex4a.cs +++ b/tests/src/baseservices/threading/waithandle/waitany/waitanyex4a.cs @@ -29,8 +29,8 @@ class WaitAnyEx try { Console.WriteLine("Waiting..."); - int i = WaitHandle.WaitAny(wh); - Console.WriteLine("WaitAny did not throw an exception"); + int i = WaitHandle.WaitAny(wh, 30000); + Console.WriteLine("WaitAny did not throw AbandonedMutexException. Result: {0}", i); } catch(AbandonedMutexException) { @@ -43,10 +43,9 @@ class WaitAnyEx private void AbandonOne() { - Mutex m = new Mutex(); foreach(WaitHandle w in wh) { - if(w.GetType() == m.GetType()) + if(w is Mutex) { w.WaitOne(); break;