chore: Avoiding binary conflicts with existing AM

Signed-off-by: ComixHe <heyuming@deepin.org>
This commit is contained in:
ComixHe
2023-08-30 13:11:15 +08:00
committed by Comix
parent 3df26e4fc2
commit 0896f845a6
7 changed files with 18 additions and 11 deletions

View File

@ -27,6 +27,9 @@ class TestApplicationManager : public testing::Test
public:
static void SetUpTestCase()
{
if (!QDBusConnection::sessionBus().isConnected()) {
GTEST_SKIP() << "skip for now.";
}
auto &bus = ApplicationManager1DBus::instance();
bus.initGlobalServerBus(DBusType::Session);
bus.setDestBus();
@ -51,6 +54,9 @@ public:
TEST_F(TestApplicationManager, identifyService)
{
if (m_am == nullptr) {
GTEST_SKIP() << "skip for now...";
}
using namespace std::chrono_literals;
// for service unit
auto workingDir = QDir::cleanPath(QDir::current().absolutePath() + QDir::separator() + ".." + QDir::separator() + "tools");
@ -73,7 +79,7 @@ TEST_F(TestApplicationManager, identifyService)
GTEST_SKIP() << "invoke systemd-run failed.";
}
std::this_thread::sleep_for(100ms);
std::this_thread::sleep_for(500ms);
auto success = pidFile.open(QFile::ReadOnly | QFile::Text | QFile::ExistingOnly);
EXPECT_TRUE(success);
@ -113,7 +119,7 @@ TEST_F(TestApplicationManager, identifyService)
{"Scope"}},
workingDir));
std::this_thread::sleep_for(100ms);
std::this_thread::sleep_for(500ms);
success = pidFile.open(QFile::ReadOnly | QFile::Text | QFile::ExistingOnly);
EXPECT_TRUE(success);