This is an automated email from the ASF dual-hosted git repository.

pengzheng pushed a commit to branch hotfix/test-package-failure
in repository https://gitbox.apache.org/repos/asf/celix.git

commit 5712dabe2269f631c99d772487ccee556e6c5fa8
Author: PengZheng <howto...@gmail.com>
AuthorDate: Mon Jun 24 17:56:09 2024 +0800

    Fix test_package error.
---
 libs/framework/gtest/src/CelixLauncherTestSuite.cc | 9 ---------
 libs/framework/src/celix_launcher.c                | 7 +++++--
 2 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/libs/framework/gtest/src/CelixLauncherTestSuite.cc 
b/libs/framework/gtest/src/CelixLauncherTestSuite.cc
index d422d577c..fa1d7fc8b 100644
--- a/libs/framework/gtest/src/CelixLauncherTestSuite.cc
+++ b/libs/framework/gtest/src/CelixLauncherTestSuite.cc
@@ -192,15 +192,6 @@ TEST_F(CelixLauncherTestSuite, 
LaunchWithInvalidConfigPropertiesTest) {
     //Then the launch will exit
     auto status = 
future.wait_for(std::chrono::milliseconds{LAUNCH_WAIT_TIMEOUT});
     EXPECT_EQ(status, std::future_status::ready);
-
-    //When launching the framework with a properties set with a negative 
shutdown period
-    auto* props = celix_properties_create();
-    ASSERT_TRUE(props != nullptr);
-    celix_properties_setDouble(props, 
CELIX_LAUNCHER_SHUTDOWN_PERIOD_IN_SECONDS, -1.0);
-    future = launchInThread({"programName"}, props, 1);
-    //Then launch will exit
-    status = future.wait_for(std::chrono::milliseconds{LAUNCH_WAIT_TIMEOUT});
-    EXPECT_EQ(status, std::future_status::ready);
 }
 
 
diff --git a/libs/framework/src/celix_launcher.c 
b/libs/framework/src/celix_launcher.c
index edf04d412..34abbfdb2 100644
--- a/libs/framework/src/celix_launcher.c
+++ b/libs/framework/src/celix_launcher.c
@@ -182,9 +182,12 @@ int celix_launcher_launchAndWait(int argc, char* argv[], 
const char* embeddedCon
         return CELIX_LAUNCHER_ERROR_EXIT_CODE;
     }
     status = celix_launcher_setGlobalFramework(framework);
-    if (status == CELIX_SUCCESS) {
-        celix_framework_waitForStop(framework);
+    if (status != CELIX_SUCCESS) {
+        
celix_bundleContext_log(celix_framework_getFrameworkContext(framework), 
CELIX_LOG_LEVEL_WARNING,
+                                "Failed to schedule celix_shutdown_check");
+        status = CELIX_SUCCESS;
     }
+    celix_framework_waitForStop(framework);
     celix_launcher_resetLauncher();
 #ifndef CELIX_NO_CURLINIT
     // Cleanup Curl

Reply via email to