From 9ad7631235faf5d85db77aa9b58f27395119c893 Mon Sep 17 00:00:00 2001 From: nan-xiansen Date: Mon, 12 Jul 2021 16:19:45 +0800 Subject: [PATCH] time_posix module unstable cases Signed-off-by: nan-xiansen Change-Id: If3d00da45a56b92b822643746c1c1f0bde6b656a --- kernel_lite/time_posix/src/AlarmTest.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/kernel_lite/time_posix/src/AlarmTest.cpp b/kernel_lite/time_posix/src/AlarmTest.cpp index 35d5dbd3c..d817fa93c 100755 --- a/kernel_lite/time_posix/src/AlarmTest.cpp +++ b/kernel_lite/time_posix/src/AlarmTest.cpp @@ -421,10 +421,13 @@ HWTEST_F(AlarmTest, testTimerGetTime, Function | MediumTest | Level3) } getMsValue[index++] = getMillisec; } - Msleep(1); + Msleep(150); for (int i = 0; i < index; i++) { /* delay should add 10 millisecond to ajust */ + if (setMillisec < (delay + 10)) { + break; + } setMillisec -= delay + 10; EXPECT_GE(getMsValue[i], setMillisec); LOG("%u, %u, %u", setMillisec, getMsValue[i], getMsValue[i] - setMillisec); @@ -633,10 +636,13 @@ HWTEST_F(AlarmTest, testGetItTimer, Function | MediumTest | Level3) } getMsValue[index++] = getMillisec; } - Msleep(1); + Msleep(150); for (int i = 0; i < index; i++) { /* delay should add 10 millisecond to ajust */ + if (setMillisec < (delay + 10)) { + break; + } setMillisec -= delay + 10; EXPECT_GE(getMsValue[i], setMillisec); LOG("%u, %u, %u", setMillisec, getMsValue[i], getMsValue[i] - setMillisec); -- GitLab