Module: wine Branch: master Commit: 48d538ba82a1564329d0cd0ac4d35685a4a80cb6 URL: https://source.winehq.org/git/wine.git/?a=commit;h=48d538ba82a1564329d0cd0ac...
Author: Francois Gouget fgouget@codeweavers.com Date: Fri May 6 14:50:31 2022 +0200
kernelbase/tests: Loosen up the Sleep() test lower bound.
It looks like Windows tries to work around the timer granularity by sometimes returning early such that the total may be a bit less than requested.
Signed-off-by: Francois Gouget fgouget@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/kernelbase/tests/sync.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/dlls/kernelbase/tests/sync.c b/dlls/kernelbase/tests/sync.c index ecbff6d5707..4dfcfde3f26 100644 --- a/dlls/kernelbase/tests/sync.c +++ b/dlls/kernelbase/tests/sync.c @@ -213,8 +213,11 @@ static void test_Sleep(void) min = 50.0 * (r1 < r2 ? r1 : r2) / 10000000.0; max = 50.0 * (r1 < r2 ? r2 : r1) / 10000000.0;
- /* Add an extra 1s to account for potential scheduling delays */ - ok(0.9 * min <= elapsed_time && elapsed_time <= 1.0 + max, + /* Windows tries to work around the timer resolution by sometimes + * returning early such that the total may be a bit less than requested! + * Also add an extra 1s to account for potential scheduling delays. + */ + ok(0.7 * min <= elapsed_time && elapsed_time <= 1.0 + max, "got %f, expected between %f and %f\n", elapsed_time, min, max); }