From: Jostein Kjønigsen Date: Thu, 4 Jun 2015 06:29:55 +0000 (+1000) Subject: Fix timing in PAL-tests for FreeBSD on hypervisors. X-Git-Tag: accepted/tizen/base/20180629.140029~6622^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=18bab6a643e9f12a9198e103765a78a90033153d;p=platform%2Fupstream%2Fcoreclr.git Fix timing in PAL-tests for FreeBSD on hypervisors. --- diff --git a/src/pal/tests/palsuite/threading/SleepEx/test2/test2.c b/src/pal/tests/palsuite/threading/SleepEx/test2/test2.c index cce842a..9bfcebf 100644 --- a/src/pal/tests/palsuite/threading/SleepEx/test2/test2.c +++ b/src/pal/tests/palsuite/threading/SleepEx/test2/test2.c @@ -20,8 +20,18 @@ const int InterruptTime = 1000; /* We need to keep in mind that BSD has a timer resolution of 10ms, so we need to adjust our delta to keep that in mind. Besides we need some tolerance to account for different scheduling strategies, heavy load - scenarios, etc */ -const DWORD AcceptableDelta = 50; + scenarios, etc. + + Real-world data also tells us we can expect a big difference between + values when run on real iron vs run in a hypervisor. + + Thread-interruption times when run on bare metal will typically yield + around 0ms on Linux and between 0 and 16ms on FreeBSD. However, when run + in a hypervisor (like VMWare ESXi) we may get values around an order of + magnitude higher, up to 110 ms for some tests. +*/ +const DWORD AcceptableDelta = 150; + const int Iterations = 5; void RunTest(BOOL AlertThread); diff --git a/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExMutexTest/WFSOExMutexTest.c b/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExMutexTest/WFSOExMutexTest.c index deacabf..5d231cd 100644 --- a/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExMutexTest/WFSOExMutexTest.c +++ b/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExMutexTest/WFSOExMutexTest.c @@ -19,8 +19,8 @@ /*Based on SleepEx/test2 */ const int ChildThreadWaitTime = 4000; -const int InterruptTime = 2000; -const int AcceptableDelta = 100; +const int InterruptTime = 2000; +const DWORD AcceptableDelta = 300; void RunTest(BOOL AlertThread); VOID PALAPI APCFunc(ULONG_PTR dwParam); diff --git a/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExSemaphoreTest/WFSOExSemaphoreTest.c b/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExSemaphoreTest/WFSOExSemaphoreTest.c index a788e72..5538883 100644 --- a/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExSemaphoreTest/WFSOExSemaphoreTest.c +++ b/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExSemaphoreTest/WFSOExSemaphoreTest.c @@ -19,8 +19,8 @@ /*Based on SleepEx/test2 */ const int ChildThreadWaitTime = 4000; -const int InterruptTime = 2000; -const int AcceptableDelta = 100; +const int InterruptTime = 2000; +const DWORD AcceptableDelta = 300; void RunTest(BOOL AlertThread); VOID PALAPI APCFunc(ULONG_PTR dwParam); diff --git a/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExThreadTest/WFSOExThreadTest.c b/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExThreadTest/WFSOExThreadTest.c index b96a905..fd9e8f0 100644 --- a/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExThreadTest/WFSOExThreadTest.c +++ b/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExThreadTest/WFSOExThreadTest.c @@ -20,7 +20,7 @@ const int ChildThreadWaitTime = 4000; const int InterruptTime = 2000; -const int AcceptableDelta = 100; +const DWORD AcceptableDelta = 300; void RunTest(BOOL AlertThread); VOID PALAPI APCFunc(ULONG_PTR dwParam);