]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test/throttle: add usleep for Thread_get::entry 8367/head
authorYan Jun <yan.jun8@zte.com.cn>
Wed, 30 Mar 2016 03:35:41 +0000 (11:35 +0800)
committerYan Jun <yan.jun8@zte.com.cn>
Wed, 30 Mar 2016 06:22:50 +0000 (14:22 +0800)
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 <yan.jun8@zte.com.cn>
src/test/common/Throttle.cc

index 804b12b3fecc7b26023ad65a27698f1ded9b3081..3581fd3363a696764e95e3e947b510ba7468b509 100644 (file)
@@ -52,6 +52,7 @@ protected:
     }
 
     virtual void *entry() {
+      usleep(5);
       waited = throttle.get(count);
       throttle.put(count);
       return NULL;