Fix ManifestDirectUpdate test 00/286400/2
authorilho kim <ilho159.kim@samsung.com>
Thu, 5 Jan 2023 07:39:51 +0000 (16:39 +0900)
committerilho kim <ilho159.kim@samsung.com>
Thu, 5 Jan 2023 09:59:09 +0000 (18:59 +0900)
If the update is performed quickly
The installed time may be the same
sleep 1 second before ManifestDirectUpdate

Change-Id: Idea086d66cb7627975d623ecf66c8deeaf0bd05d
Signed-off-by: ilho kim <ilho159.kim@samsung.com>
test/smoke_tests/smoke_test.cc

index 53377a8..4f81d90 100644 (file)
@@ -720,11 +720,12 @@ TEST_F(SmokeTest, ManifestDirectUpdateMode) {
 
   ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::OK);
   int install_time = GetAppInstalledTime(appid.c_str(), params.test_user.uid);
+  sleep(1);
   ASSERT_EQ(backend.ManifestDirectInstall(pkgid),
             ci::AppInstaller::Result::OK);
-  ASSERT_TRUE(GetAppInstalledTime(appid.c_str(),
-                                  params.test_user.uid) > install_time)
-      << "Package is not updated (app installed time didn't change).";
+  ASSERT_GT(
+      GetAppInstalledTime(appid.c_str(), params.test_user.uid), install_time)
+          << "Package is not updated (app installed time didn't change).";
   ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params));
 }
 
@@ -778,10 +779,11 @@ TEST_F(HybridSmokeTest, ManifestDirectUpdateMode) {
 
   ASSERT_EQ(backend.Install(path), ci::AppInstaller::Result::OK);
   int install_time = GetAppInstalledTime(appid.c_str(), params.test_user.uid);
+  sleep(1);
   ASSERT_EQ(backend.ManifestDirectInstall(pkgid), ci::AppInstaller::Result::OK);
-  ASSERT_TRUE(GetAppInstalledTime(appid.c_str(),
-                                  params.test_user.uid) > install_time)
-      << "Package is not updated (app installed time didn't change).";
+  ASSERT_GT(
+      GetAppInstalledTime(appid.c_str(), params.test_user.uid), install_time)
+          << "Package is not updated (app installed time didn't change).";
   ASSERT_TRUE(ValidatePackage(pkgid, {appid}, params));
 }