From 11333961cebd5ee4a388c448541e57c43ea3dc39 Mon Sep 17 00:00:00 2001 From: Yan Jun Date: Wed, 30 Mar 2016 11:35:41 +0800 Subject: [PATCH] test/throttle: add usleep for Thread_get::entry In the test case ThrottleTest.get, we try to delay one or a few microseconds to do throttle.put that will wake up a waited throttle, and we expect t.waited is false for short delay and true for long delay, however the result did not meet our expectations since even one microseconds is too long. Maybe we should add usleep for Thread_get::entry. Signed-off-by: Yan Jun --- src/test/common/Throttle.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/test/common/Throttle.cc b/src/test/common/Throttle.cc index 804b12b3fecc..3581fd3363a6 100644 --- a/src/test/common/Throttle.cc +++ b/src/test/common/Throttle.cc @@ -52,6 +52,7 @@ protected: } virtual void *entry() { + usleep(5); waited = throttle.get(count); throttle.put(count); return NULL; -- 2.47.3