Commit 0079d73e9f617a0ece58dbc19327f0ac84f338f9

Authored by Jürgen Knödlseder
1 parent 9575a0e0

Add a bit of sleeping.

src/vo/GVOClient.cpp
@@ -41,6 +41,7 @@ @@ -41,6 +41,7 @@
41 41
42 /* __ Method name definitions ____________________________________________ */ 42 /* __ Method name definitions ____________________________________________ */
43 #define G_FIND_HUB "GVOClient::find_hub()" 43 #define G_FIND_HUB "GVOClient::find_hub()"
  44 +#define G_REQUIRE_HUB "GVOClient::require_hub()"
44 #define G_REGISTER_TO_HUB "GVOClient::register_to_hub()" 45 #define G_REGISTER_TO_HUB "GVOClient::register_to_hub()"
45 46
46 /* __ Macros _____________________________________________________________ */ 47 /* __ Macros _____________________________________________________________ */
@@ -620,7 +621,7 @@ bool GVOClient::require_hub(void) @@ -620,7 +621,7 @@ bool GVOClient::require_hub(void)
620 int pid = fork(); 621 int pid = fork();
621 if (pid < 0) { 622 if (pid < 0) {
622 std::string msg = "Unable to create child process for VO Hub."; 623 std::string msg = "Unable to create child process for VO Hub.";
623 - throw GException::runtime_error(G_FIND_HUB, msg); 624 + throw GException::runtime_error(G_REQUIRE_HUB, msg);
624 } 625 }
625 626
626 // If we have a PID of 0 we are in the child process. In this case 627 // If we have a PID of 0 we are in the child process. In this case
@@ -639,7 +640,6 @@ bool GVOClient::require_hub(void) @@ -639,7 +640,6 @@ bool GVOClient::require_hub(void)
639 for (int i = 0; i < 5; ++i) { 640 for (int i = 0; i < 5; ++i) {
640 found = find_hub() && ping_hub(); 641 found = find_hub() && ping_hub();
641 if (found) { 642 if (found) {
642 -std::cout << "*** Hub is alive ***" << std::endl;  
643 break; 643 break;
644 } 644 }
645 sleep(1); 645 sleep(1);
test/test_GVO.cpp
@@ -120,6 +120,9 @@ void TestGVO::test_GVOHub(void) @@ -120,6 +120,9 @@ void TestGVO::test_GVOHub(void)
120 // We now shutdown the Hub via the client 120 // We now shutdown the Hub via the client
121 client.shutdown_hub(); 121 client.shutdown_hub();
122 122
  123 + // Sleep a bit to make sure that we exit without a Hub
  124 + sleep(1);
  125 +
123 // Return 126 // Return
124 return; 127 return;
125 } 128 }