未验证 提交 63b6bbc7 编写于 作者: O openharmony_ci 提交者: Gitee

!1915 fix:超时时间修改成15s

Merge pull request !1915 from cheng_jinsong/deviceinfo15
......@@ -42,9 +42,9 @@ REGISTER_SYSTEM_ABILITY_BY_ID(DeviceInfoService, SYSPARAM_DEVICE_SERVICE_ID, tru
static std::mutex g_lock;
static time_t g_lastTime;
#ifndef STARTUP_INIT_TEST
static const int DEVICE_INFO_EXIT_TIMEOUT_MS = 60;
static const int DEVICE_INFO_EXIT_TIMEOUT_MS = 15;
#else
static const int DEVICE_INFO_EXIT_TIMEOUT_MS = 2;
static const int DEVICE_INFO_EXIT_TIMEOUT_MS = 3;
#endif
static void UnloadDeviceInfoSa(int signo)
......@@ -53,7 +53,7 @@ static void UnloadDeviceInfoSa(int signo)
time_t currTime;
(void)time(&currTime);
if (difftime(currTime, g_lastTime) < DEVICE_INFO_EXIT_TIMEOUT_MS) {
alarm(DEVICE_INFO_EXIT_TIMEOUT_MS / 2); // 2 half
alarm(DEVICE_INFO_EXIT_TIMEOUT_MS / 3); // 3 half
return;
}
DINFO_LOGI("DeviceInfoService::UnloadDeviceInfoSa");
......
......@@ -27,8 +27,7 @@
"bootchart start",
"chown access_token access_token /dev/access_token_id",
"chmod 0666 /dev/access_token_id",
"trigger init-hitrace",
"trigger init-trace"
"trigger init-hitrace"
]
}, {
"name" : "init",
......
......@@ -20,9 +20,6 @@ static int InitTraceEarlyHook(const HOOK_INFO *info, void *cookie)
{
if (GetBootEventEnable()) {
PLUGIN_LOGI("init trace enabled.");
#ifndef STARTUP_INIT_TEST
InitModuleMgrInstall("inittrace");
#endif
return 0;
}
return 0;
......
......@@ -50,7 +50,7 @@ HWTEST_F(DeviceInfoModuleTest, DeviceInfoGetUdid_001, TestSize.Level0)
EXPECT_EQ(object != nullptr, 1);
BEGET_ERROR_CHECK(object != nullptr, return, "Get deviceinfo manager object from samgr failed");
std::this_thread::sleep_for(std::chrono::seconds(80)); // wait sa died 80s
std::this_thread::sleep_for(std::chrono::seconds(20)); // wait sa died 20s
object = samgr->GetSystemAbility(SYSPARAM_DEVICE_SERVICE_ID);
EXPECT_EQ(object == nullptr, 1);
......@@ -77,7 +77,7 @@ HWTEST_F(DeviceInfoModuleTest, DeviceInfoGetSerial_001, TestSize.Level0)
EXPECT_EQ(object != nullptr, 1);
BEGET_ERROR_CHECK(object != nullptr, return, "Get deviceinfo manager object from samgr failed");
std::this_thread::sleep_for(std::chrono::seconds(80)); // wait sa died 80s
std::this_thread::sleep_for(std::chrono::seconds(20)); // wait sa died 20s
object = samgr->GetSystemAbility(SYSPARAM_DEVICE_SERVICE_ID);
EXPECT_EQ(object == nullptr, 1);
......
......@@ -84,7 +84,7 @@ HWTEST_F(ServiceWatcherModuleTest, serviceWatcher_test_003, TestSize.Level0)
auto status1 = GetServiceStatus(serviceName);
EXPECT_TRUE(status1 == "running");
// wait service exit
std::this_thread::sleep_for(std::chrono::seconds(80)); // wait sa died 80s
std::this_thread::sleep_for(std::chrono::seconds(20)); // wait sa died 20s
auto status2 = GetServiceStatus(serviceName);
EXPECT_TRUE(status2 == "stopped");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册