[UTC][component-based-application][Non-ACR][Fix test code] 79/224679/1
authorHwankyu Jhun <h.jhun@samsung.com>
Wed, 12 Feb 2020 08:14:22 +0000 (17:14 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Wed, 12 Feb 2020 08:14:22 +0000 (17:14 +0900)
- Use usleep() instead of sleep()

Change-Id: I1364d9d4d6fbdbd842d50e45eb2f22cbdd666f6b
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/utc/component-based-application/utc-component-based-app.c

index bbf09e01aeef2820f60c2a99bc33102fefa9fb5b..15354e2bfdf734b5da18e75567394ac4b014e3fa 100644 (file)
@@ -561,15 +561,22 @@ int utc_frame_component_get_window_n(void)
 int utc_component_based_app_exit_p(void)
 {
        int ret;
-       bool running;
+       bool running = true;
+       int retry_count = 0;
 
        ret =  __app_control_send_async(g_app_id, g_service_comp_id,
                        "utc_component_based_app_exit");
-       assert_eq_with_exit(ret, APP_CONTROL_RESULT_SUCCEEDED);
+       assert_eq_with_exit(ret, APP_CONTROL_ERROR_NONE);
+
+        do {
+               component_manager_is_running(g_service_comp_id, &running);
+                if (!running)
+                       break;
 
-       sleep(5);
+                usleep(500000);
+                retry_count++;
+        } while (retry_count <= 10);
 
-       ret = component_manager_is_running(g_service_comp_id, &running);
        assert_eq_with_exit(running, false);
 
        normal_exit(0);